bug #9499 Request::overrideGlobals() may call invalid ini value (denkiryokuhatsuden)

This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #9499).

Discussion
----------

Request::overrideGlobals() may call invalid ini value

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | perhaps
| Deprecations? | no
| Tests pass?   | -
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

According to http://php.net/manual/ja/ini.core.php ,
there's not variable_order, but variables_order (with trailing "s").

Perhaps it breaks BC for some developer who unsets (sets falsy value to )
'request_order' ini value and sets 'variable_order' manually?

Commits
-------

7f43fb8 Request::overrideGlobals() may call invalid ini value
This commit is contained in:
Fabien Potencier 2013-11-13 09:30:53 +01:00
commit 2866bd4956

View File

@ -482,7 +482,7 @@ class Request
$request = array('g' => $_GET, 'p' => $_POST, 'c' => $_COOKIE); $request = array('g' => $_GET, 'p' => $_POST, 'c' => $_COOKIE);
$requestOrder = ini_get('request_order') ?: ini_get('variable_order'); $requestOrder = ini_get('request_order') ?: ini_get('variables_order');
$requestOrder = preg_replace('#[^cgp]#', '', strtolower($requestOrder)) ?: 'gp'; $requestOrder = preg_replace('#[^cgp]#', '', strtolower($requestOrder)) ?: 'gp';
$_REQUEST = array(); $_REQUEST = array();