Jun 3, 2011 at 4:55 PM
Edited Jun 3, 2011 at 5:01 PM
I'am using the Microsoft.Security.Application.Sanitizer.GetSafeHtmlFragment() method to encode HTML input.
However, after the sanitization image tags always look like
<img src="" alt=""></img>
. This is perfectly okay for the browser, but no valid XML. Since I'am using XElement.Parse method for validation and for getting an XElement from the input, the method throws an exception because of the not closed img tag.
Will that be fixed or is there a good reason for removing the "/" from an empty element?