Skip to content

Commit 11d79cb

Browse files
committed
bug symfony#24956 Fix ambiguous pattern (weltling)
This PR was merged into the 2.7 branch. Discussion ---------- Fix ambiguous pattern [Validator][Constraints][UrlValidator] Fix domain name pattern. | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | `\pS` is a unicode character class, `\pS-\.` pretends to be a range which is not. This pattern fails with PCRE2. Thanks. Commits ------- 059f59a Fix ambiguous pattern
2 parents c963178 + 059f59a commit 11d79cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class UrlValidator extends ConstraintValidator
2525
(%s):// # protocol
2626
(([\.\pL\pN-]+:)?([\.\pL\pN-]+)@)? # basic auth
2727
(
28-
([\pL\pN\pS-\.])+(\.?([\pL\pN]|xn\-\-[\pL\pN-]+)+\.?) # a domain name
28+
([\pL\pN\pS\-\.])+(\.?([\pL\pN]|xn\-\-[\pL\pN-]+)+\.?) # a domain name
2929
| # or
3030
\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} # an IP address
3131
| # or

0 commit comments

Comments
 (0)