1
Vote

Image tags being stripped out

description

I'm using TinyMCE with uForum to enable users to format and upload images with their posts (in the same way as on our.umbraco).
 
The Utills.Sanitize method has img on the whitelist RegEx, so it should be allowed, but the method also has "detailed img tag checking" which is stripping out all my image tags:
 
// detailed <img> tag checking
                if (!IsMatch(tagname,
                    @"<img\s
          src=""https?://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+""
          (\swidth=""\d{1,3}"")?
          (\sheight=""\d{1,3}"")?
          (\salt=""[^""]*"")?
          (\stitle=""[^""]*"")?
          \s?/?>"))
                {
                    html = html.Remove(tag.Index, tag.Length);
                }
 
I've commented this part out of Utills.cs for now to get images working again, but wondered what this was for?

comments