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:
Fabien Potencier 2015-02-04 08:33:11 +01:00
commit a6f1e8ca07
1 changed files with 1 additions and 1 deletions

View File

@ -1847,7 +1847,7 @@ class Request
$len = strlen($prefix);
if (preg_match("#^(%[[:xdigit:]]{2}|.){{$len}}#", $string, $match)) {
if (preg_match(sprintf('#^(%%[[:xdigit:]]{2}|.){%d}#', $len), $string, $match)) {
return $match[0];
}