By John Bongiovanni on Saturday, 18 February 2017
Posted in General
Replies 5
Likes 0
Views 184
Votes 0
I entered a ticket on animated gifs (https://stackideas.com/forums/issues-uploading-gif-animation). What I wanted to do was add an animated gif to the post, but also have it not play until the user clicked on it.

After research here and elsewhere, I loaded a static version of the gif using the JCE select image, which produced this HTML:
<img src="XXXX">
Using the JCE code editor, I wrapped it with the following:
<a href="#" onClick="Animation=window.open('YYYY', 'Animation', width='700', height='700');return false;>
<img src="YYYY"> </a>

where YYYY is a reference to the animated gif.

It all worked in preview, but when I submitted the post, the <a> got changed to <a href="#">

Then I edited the post, replacing the custom <a> with the one above, and updated it. This time, it preserved the custom HTML, and it all works fine.

So I don't need help on this, but I'm reporting the problem that the custom HTML is changed on post submit.
Hello John,

I believe the code changes are actually done by the editor itself (JCE) as soon as you save. To verify that, could you try switching your editor to "codemirror" or "none" and try placing your html codes and see if the anchor links are being rewritten?
·
Sunday, 19 February 2017 01:06
·
0 Likes
·
0 Votes
·
0 Comments
·
I installed the Emmet/codemirror editor and set it as the default editor. I wrote a test blog, modifying the HTML as I mentioned in the process. The result was the same. It stripped out the "onclick" in the <a> attribute.
·
Sunday, 19 February 2017 18:15
·
0 Likes
·
0 Votes
·
0 Comments
·
Hm, are you logged in as a super user to post the blog post or as a normal registered user? EasyBlog has a security in place by default that prevents normal registered users from adding harmful attributes that may affect your site.

You can find this under ACL > Register Users, http://take.ms/F1QyJ
·
Sunday, 19 February 2017 20:39
·
0 Likes
·
0 Votes
·
0 Comments
·
Yes, I'm entering it as Super User.
I did some more work, and I noticed the following difference with Emmet/codemirror.
With JCE, the JTML gets stripped on the initial post, but I can edit it (back-end) back in. With Emmet/codemirror, it gets stripped, and I cannot edit it back in. I checked the System Config settings, and SuperUser has no filtering.
·
Monday, 20 February 2017 09:54
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

From i have test, using JCE and HTML below,

<p><a onclick="Animation=window.open('images/giphy.gif', 'Animation', width='700', height='700')"> <img src="images/giphy.gif" alt="giphy" /> </a> testsstst</p>


Those HTML is not strip from the first time we post and is not shown <a href=#> as you can see here https://screencast.com/t/oTaBaxMmOeX

Is it the correct way? Maybe you can provide us with you backend and FTP access for further check on this issues.
·
Monday, 20 February 2017 12:57
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post