diff options
| author | Cody Robibero <cody@robibe.ro> | 2026-08-30 17:52:39 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-30 17:52:39 -0400 |
| commit | 7d6633ad1e9b4b69be87b2ac601fcadbacc37376 (patch) | |
| tree | 6226761d735d99cd3114eb781177cd2435d0a9bf /src | |
| parent | 420d44f638c44b942b43303c3165c2e8795b9020 (diff) | |
| parent | 11adad0e67f9487536ed8e727955645c4dee4244 (diff) | |
Merge pull request #17744 from Shadowghost/fix-master
Fix formatting and test
Diffstat (limited to 'src')
| -rw-r--r-- | src/Jellyfin.Drawing.Skia/SvgSecurityValidator.cs | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/src/Jellyfin.Drawing.Skia/SvgSecurityValidator.cs b/src/Jellyfin.Drawing.Skia/SvgSecurityValidator.cs index f8a1d7d443..65f35643b2 100644 --- a/src/Jellyfin.Drawing.Skia/SvgSecurityValidator.cs +++ b/src/Jellyfin.Drawing.Skia/SvgSecurityValidator.cs @@ -83,48 +83,48 @@ internal static class SvgSecurityValidator switch (reader.NodeType) { case XmlNodeType.DocumentType: - { - var subset = reader.Value; - if (!string.IsNullOrEmpty(subset) - && (subset.Contains("SYSTEM", StringComparison.OrdinalIgnoreCase) - || subset.Contains("PUBLIC", StringComparison.OrdinalIgnoreCase))) { - return "The document declares an external DTD entity"; - } + var subset = reader.Value; + if (!string.IsNullOrEmpty(subset) + && (subset.Contains("SYSTEM", StringComparison.OrdinalIgnoreCase) + || subset.Contains("PUBLIC", StringComparison.OrdinalIgnoreCase))) + { + return "The document declares an external DTD entity"; + } - break; - } + break; + } case XmlNodeType.Element when reader.HasAttributes: - { - for (var i = 0; i < reader.AttributeCount; i++) { - reader.MoveToAttribute(i); - var isHref = reader.LocalName.Equals("href", StringComparison.OrdinalIgnoreCase); - var reason = isHref - ? ValidateReference(reader.Value, depth, "href") - : ValidateCss(reader.Value, depth); - if (reason is not null) + for (var i = 0; i < reader.AttributeCount; i++) { - return reason; + reader.MoveToAttribute(i); + var isHref = reader.LocalName.Equals("href", StringComparison.OrdinalIgnoreCase); + var reason = isHref + ? ValidateReference(reader.Value, depth, "href") + : ValidateCss(reader.Value, depth); + if (reason is not null) + { + return reason; + } } - } - reader.MoveToElement(); - break; - } + reader.MoveToElement(); + break; + } case XmlNodeType.Text: case XmlNodeType.CDATA: - { - var reason = ValidateCss(reader.Value, depth); - if (reason is not null) { - return reason; - } + var reason = ValidateCss(reader.Value, depth); + if (reason is not null) + { + return reason; + } - break; - } + break; + } } } |
