Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 389d72f

Browse files
committed
allow more unicode characters in URL paths
1 parent 54641cb commit 389d72f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Symfony/Component/Validator/Constraints/UrlValidator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class UrlValidator extends ConstraintValidator
4040
\] # an IPv6 address
4141
)
4242
(:[0-9]+)? # a port (optional)
43-
(?:/ (?:[\pL\pN\-._\~!$&\'()*+,;=:@]|%%[0-9A-Fa-f]{2})* )* # a path
43+
(?:/ (?:[\pL\pN\pS\pM\-._\~!$&\'()*+,;=:@]|%%[0-9A-Fa-f]{2})* )* # a path
4444
(?:\? (?:[\pL\pN\-._\~!$&\'\[\]()*+,;=:@/?]|%%[0-9A-Fa-f]{2})* )? # a query (optional)
4545
(?:\# (?:[\pL\pN\-._\~!$&\'()*+,;=:@/?]|%%[0-9A-Fa-f]{2})* )? # a fragment (optional)
4646
$~ixu';

src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ public static function getValidUrls()
174174
['http://symfony.com/#one_more%20test'],
175175
['http://example.com/exploit.html?hello[0]=test'],
176176
['http://বিডিআইএ.বাংলা'],
177+
['http://www.example.com/คนแซ่ลี้/'],
178+
['http://www.example.com/か/'],
177179
];
178180
}
179181

0 commit comments

Comments
 (0)