Skip to content

Commit 68fc2c4

Browse files
committed
bug symfony#57905 [Validator] allow more unicode characters in URL paths (xabbuh)
This PR was merged into the 5.4 branch. Discussion ---------- [Validator] allow more unicode characters in URL paths | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix symfony#54937 | License | MIT Commits ------- eba88f8 allow more unicode characters in URL paths
2 parents a91d20d + eba88f8 commit 68fc2c4

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 0 deletions
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)