I am using HTML sanitizer to detect tag or script in input but I want to allow some characters in input like &, *. However, the sanitizer method replace the character & to & which is wrong What I have tried: public static bool IsDangerousString(string raw) { // Using HTML sanitizer nuget for more info https://github.com/mganss/HtmlSanitizer raw = abc&123; var sanitiser = new HtmlSanitizer(); var sanitised = sanitiser.Sanitize(raw); return raw != sanitised; // should return false but returns true }
&
&
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)