Skip to content

Commit

Permalink
suppress SYSLIB0013 warning
Browse files Browse the repository at this point in the history
  • Loading branch information
HAspNetCore committed Dec 12, 2024
1 parent 1b24a13 commit 6ffb57a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Security/IdentityServer4.Security/Sanitizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ public JsonSanitizer() : base(HttpUtility.JavaScriptStringEncode)
}
public class UrlSanitizer : SanitizerBase, IUrlSanitizer
{
#pragma warning disable SYSLIB0013 // 类型或成员已过时
public UrlSanitizer() : base(x => Uri.EscapeUriString(x?.ToString() ?? ""))
#pragma warning restore SYSLIB0013 // 类型或成员已过时
{

}
Expand All @@ -227,7 +229,9 @@ public CssSanitizer() : base()
}
public class ScriptSanitizer : SanitizerBase, IScriptSanitizer
{
#pragma warning disable SYSLIB0013 // 类型或成员已过时
public ScriptSanitizer() : base(x => Uri.EscapeUriString(x?.ToString() ?? ""))
#pragma warning restore SYSLIB0013 // 类型或成员已过时
{

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ public static string SanitizeForRedirect(this object? input, SanitizerMode mode
{
var decoded = Uri.UnescapeDataString(input?.ToString() ?? "");
decoded.SanitizeForHtml();
#pragma warning disable SYSLIB0013 // 类型或成员已过时
var escaped = Uri.EscapeUriString(decoded);
#pragma warning restore SYSLIB0013 // 类型或成员已过时
return escaped;
}

Expand Down

0 comments on commit 6ffb57a

Please sign in to comment.