Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Fraser Skea 10 posts 30 karma points
    Jun 20, 2013 @ 15:50
    Fraser Skea
    0

    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

  • Tom Fulton 2030 posts 4996 karma points c-trib
    Jun 20, 2013 @ 16:29
    Tom Fulton
    0

    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

  • Fraser Skea 10 posts 30 karma points
    Jun 20, 2013 @ 16:34
    Fraser Skea
    0

    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

  • Fraser Skea 10 posts 30 karma points
    Jun 20, 2013 @ 16:36
    Fraser Skea
    0

    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..."/>

  • Tom Fulton 2030 posts 4996 karma points c-trib
    Jun 20, 2013 @ 16:42
    Tom Fulton
    0

    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.

  • Fraser Skea 10 posts 30 karma points
    Jun 20, 2013 @ 16:52
    Fraser Skea
    0

    Cool, I'll raise an issue, and possibly have a quick look through that code.

    Thanks



  • Fraser Skea 10 posts 30 karma points
    Jun 21, 2013 @ 10:35
    Fraser Skea
    0

    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

  • Tom Fulton 2030 posts 4996 karma points c-trib
    Jun 22, 2013 @ 00:50
    Tom Fulton
    0

    Ah, nice find.  Sounds like it could be a simple pull request.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies