Skip to content

Commit f978fcf

Browse files
tgalopinnicolas-grekas
authored andcommitted
Fix HtmlSanitizer default configuration behavior for allowed schemes
1 parent 28d1912 commit f978fcf

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

Tests/TextSanitizer/UrlSanitizerTest.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,33 @@ public function provideSanitize()
4545
'output' => null,
4646
];
4747

48+
yield [
49+
'input' => 'http://trusted.com/link.php',
50+
'allowedSchemes' => null,
51+
'allowedHosts' => null,
52+
'forceHttps' => false,
53+
'allowRelative' => false,
54+
'output' => 'http://trusted.com/link.php',
55+
];
56+
57+
yield [
58+
'input' => 'https://trusted.com/link.php',
59+
'allowedSchemes' => null,
60+
'allowedHosts' => null,
61+
'forceHttps' => false,
62+
'allowRelative' => false,
63+
'output' => 'https://trusted.com/link.php',
64+
];
65+
66+
yield [
67+
'input' => 'data:text/plain;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
68+
'allowedSchemes' => null,
69+
'allowedHosts' => null,
70+
'forceHttps' => false,
71+
'allowRelative' => false,
72+
'output' => 'data:text/plain;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
73+
];
74+
4875
yield [
4976
'input' => 'https://trusted.com/link.php',
5077
'allowedSchemes' => ['https'],

0 commit comments

Comments
 (0)