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

Skip to content

Commit 3bc4d1a

Browse files
author
Emmanuel BORGES
committed
cs fix
1 parent 18ad3cd commit 3bc4d1a

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/Symfony/Component/Validator/CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ CHANGELOG
99
* added option `allowNull` to NotBlank constraint
1010
* added `Json` constraint
1111
* added `Unique` constraint
12-
* Add the `allowExtraChars` options from the `Url` constraint to allow brackets in the optional query string.
13-
* Add the `allowBrackets` options from the `Url` constraint to allow brackets in the optional query string.
14-
12+
* Added the `allowBrackets` option to the `Url` constraint to allow brackets in the optional query string.
13+
1514
4.2.0
1615
-----
1716

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,7 @@ public function validate($value, Constraint $constraint)
6464

6565
$pattern = static::PATTERN;
6666
if ($constraint->allowBrackets) {
67-
$pattern = str_replace(
68-
'(?:\? (?:[\pL\pN\-._\~!$&\'()*+,;=:@/?]|%%[0-9A-Fa-f]{2})* )?',
69-
'(?:\? (?:[\pL\pN\-._\~!$&\'\[\]()*+,;=:@/?]|%%[0-9A-Fa-f]{2})* )?',
70-
$pattern
71-
);
67+
$pattern = str_replace('(?:\? (?:[\pL\pN\-._\~!$&\'()*+,;=:@/?]|%%[0-9A-Fa-f]{2})* )?', '(?:\? (?:[\pL\pN\-._\~!$&\'\[\]()*+,;=:@/?]|%%[0-9A-Fa-f]{2})* )?', $pattern);
7268
}
7369

7470
$pattern = $constraint->relativeProtocol ? str_replace('(%s):', '(?:(%s):)?', $pattern) : $pattern;

0 commit comments

Comments
 (0)