Skip to content

Commit 79f847b

Browse files
[6.x] Fix SVG sanitization tests (#14483)
1 parent 9ffea2b commit 79f847b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"pixelfear/composer-dist-plugin": "^0.1.4",
2828
"pragmarx/google2fa": "^8.0 || ^9.0",
2929
"rebing/graphql-laravel": "^9.15",
30-
"rhukster/dom-sanitizer": "^1.0.7",
30+
"rhukster/dom-sanitizer": "^1.0.10",
3131
"spatie/blink": "^1.3",
3232
"spatie/error-solutions": "^1.0 || ^2.0",
3333
"statamic/stringy": "^3.1.2",

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)