Quantcast
Channel: AjaxControlToolkit Work Item Rss Feed
Viewing all articles
Browse latest Browse all 4356

Commented Issue: InsertImage in HTML Editor Extender breaks html when saved to a database [27233]

$
0
0
After having succesfully added an image to my HTML Editor Extender, when I save it to the database the html becomes invalid, basically it escapes the HTML (i.e. so < becomes &lt; and > becomes &gt;) thus destroying the <img src=""> tag

Note:
This only happens with the <img src=""> the rest of the html is left unscathed. which I find rather strange.
Comments: Probably the src attribute contains backslash characters. The current HtmlEditorExtender.Decode method does not recognize the attribute value (e.g. ".\Images\MyImage.jpg") as a valid one. Adding the backslash to the attributeCharacters will fix the issue. Imo an backslash within the attribute value cannot harm. HtmlEditorExtender.cs public string Decode(string value) { .... //string attributeCharacters = "\\'\\,\\w\\-#\\s\\:\\;\\?\\&\\.\\-\\="; string attributeCharacters = "\\'\\,\\w\\-#\\s\\:\\;\\?\\&\\.\\-\\=\\\"; .... }

Viewing all articles
Browse latest Browse all 4356

Trending Articles