minor #13583 [HttpFoundation] minor: clarify Request::getUrlencodedPrefix() regex (dunglas)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #13583).
Discussion
----------
[HttpFoundation] minor: clarify Request::getUrlencodedPrefix() regex
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
| Doc PR | n/a
The current notation used is confusing and displays an error in PHPStorm (probably a false positive). This PR clarify the notation.
Commits
-------
1aba7b4
[HttpFoundation] minor: clarify Request::getUrlencodedPrefix() regex
This commit is contained in:
commit
a6f1e8ca07
@ -1847,7 +1847,7 @@ class Request
|
|||||||
|
|
||||||
$len = strlen($prefix);
|
$len = strlen($prefix);
|
||||||
|
|
||||||
if (preg_match("#^(%[[:xdigit:]]{2}|.){{$len}}#", $string, $match)) {
|
if (preg_match(sprintf('#^(%%[[:xdigit:]]{2}|.){%d}#', $len), $string, $match)) {
|
||||||
return $match[0];
|
return $match[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user