diff --git a/blazor/common/security/cross-site-scripting-prevention.md b/blazor/common/security/cross-site-scripting-prevention.md index 2f3a42ba7..2b63457d7 100644 --- a/blazor/common/security/cross-site-scripting-prevention.md +++ b/blazor/common/security/cross-site-scripting-prevention.md @@ -469,7 +469,6 @@ public class HtmlSanitizerService public string Sanitize(string input) { - // Return empty string if the input is null or whitespace. if (string.IsNullOrWhiteSpace(input)) return string.Empty; @@ -487,12 +486,8 @@ public class HtmlSanitizerService var isClosing = !string.IsNullOrEmpty(match.Groups[1].Value); var tagName = match.Groups[2].Value; var attrText = match.Groups[3].Value; - - // Drop any tag not explicitly allowed. if (!allowList.Contains(tagName)) return string.Empty; - - // Preserve closing tag as-is (e.g.,
). if (isClosing) return $"{tagName}>"; @@ -509,13 +504,8 @@ public class HtmlSanitizerService // Remove any event handler attributes (onclick, onerror, etc.). if (name.StartsWith("on", StringComparison.OrdinalIgnoreCase)) continue; - /* - NOTE: - The sanitizer includes special handling for href/src for future expansion. - Since and