Search code examples
antixsslibrary

Allowing local URL in Microsoft.Security.Application.Sanitizer.GetSafeHtmlFragment


Microsoft.Security.Application.Sanitizer.GetSafeHtmlFragment seems to strip all <a href="">link</a> into <a>link</a>

Is there anyway to preserve local URL, e.g. <a href="/Product/1"> when passing it into Sanitizer.GetSafeHtmlFragment?

Note: I'm using AntiXSS 4.2.1


Solution

  • The AntiXSS library has been broken for a few months now. There's no way around this problem, unfortunately. Either you rollback to a previous version, or search for something else to use.