Tinymce strips 'src' attribute from images on upgrade to 4.11.8
Hi,
I recently upgraded a site from version from version 4.11.5 to 4.11.8. I am inserting images in the base64 embedded form below into the rich text editor. These were displaying correctly in version 4.11.5 but on upgrading these are now stripped down to only a blank img tag on saving.
Out of curiousity, does it work with regular images inserted from the media library or pointing to a web path? I wonder if it's a problem with the format of your src as pasted above.
There was a bug where src attribute was being stripped in 4.11.2, but it was fixed a while back - and having src in your allowedAttributes should have worked around it anyway.
Thanks for the reply. Yeah standard images pointing to over the web or to the media section is fine. It is only when I try and embed images as above (which is sadly a requirement of my site).
Ah - in that case your best bet is probably to report an issue on the issue tracker as it sounds like a bug. Or if you're up for debugging, I would start around tinyMCEImageHelper.cs as that's where the src stripping was happening before.
This seems to be caused by this issue, the regex appears to strip out the encoded value if it ends in an equals. I just did some testing this is the behavior in 4.11.8 and 4.11.9
Tinymce strips 'src' attribute from images on upgrade to 4.11.8
Hi,
I recently upgraded a site from version from version 4.11.5 to 4.11.8. I am inserting images in the base64 embedded form below into the rich text editor. These were displaying correctly in version 4.11.5 but on upgrading these are now stripped down to only a blank img tag on saving.
img src="/forum/data:image/png;base64,iVBORw0KGgoAAAANSUhEU.." alt="data plot"
I have the following settings in my config files:
umbracoSettings.config
src,alt,border,class,style,align,id,name,onclick,usemap
False
tinyMceConfig.config
Does anyone have any ideas what I can do to prevent this stripping of attributes, or this is an issue with particular version?
Thanks
Hi Fraser,
Out of curiousity, does it work with regular images inserted from the media library or pointing to a web path? I wonder if it's a problem with the format of your src as pasted above.
There was a bug where src attribute was being stripped in 4.11.2, but it was fixed a while back - and having src in your allowedAttributes should have worked around it anyway.
-Tom
Hi Tom,
Thanks for the reply. Yeah standard images pointing to over the web or to the media section is fine. It is only when I try and embed images as above (which is sadly a requirement of my site).
Fraser
I appear to have had a markup issue when editing my post above, the image tage is of the form
<imgsrc="data:image/jpeg;base64,/9j/4AAQSkZJRgAB..."/>
Ah - in that case your best bet is probably to report an issue on the issue tracker as it sounds like a bug. Or if you're up for debugging, I would start around tinyMCEImageHelper.cs as that's where the src stripping was happening before.
Cool, I'll raise an issue, and possibly have a quick look through that code.
Thanks
This seems to be caused by this issue, the regex appears to strip out the encoded value if it ends in an equals. I just did some testing this is the behavior in 4.11.8 and 4.11.9
Ah, nice find. Sounds like it could be a simple pull request.
is working on a reply...