Skip to content

Commit b318355

Browse files
committed
sanitize style tags before passing to dom-sanitizer
1 parent 66c7da3 commit b318355

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Support/Svg.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ public static function sanitize(string $svg, ?DOMSanitizer $sanitizer = null): s
2020
{
2121
$sanitizer = $sanitizer ?? new DOMSanitizer(DOMSanitizer::SVG);
2222

23-
$svg = $sanitizer->sanitize($svg, [
23+
$svg = static::sanitizeStyleTags($svg);
24+
25+
return $sanitizer->sanitize($svg, [
2426
'remove-xml-tags' => ! Str::startsWith($svg, '<?xml'),
2527
]);
26-
27-
return static::sanitizeStyleTags($svg);
2828
}
2929

3030
public static function sanitizeCss(string $css): string

0 commit comments

Comments
 (0)