我目前使用的微软AntiXSS库和使用GetSafeHtmlFragment
方法如下:Microsoft Anti XSS Library编码&符号?
public static string SanitizeHtml(this string s)
{
return Sanitizer.GetSafeHtmlFragment(s);
}
但是,如果我在一个字符串传递这样的:
black & white
...这是编码&符号,因此它变成:
black & white
此库这个正常的行为?有没有办法阻止它编码这个字符?
我相信这是正常的行为,因为你正在使用'GetSafeHtmlFragmet' –