File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -31,17 +31,16 @@ final class RequestGlobalsContext implements NonceContextInterface
3131 private $ context ;
3232
3333 /**
34- * Constructor.
35- *
3634 * We don't use `$_REQUEST` because, by default, in PHP it gives precedence to `$_GET` over
3735 * `$_POST` in POST requests, and being dependant on `request_order` / `variables_order` ini
3836 * configurations it is not consistent across systems.
3937 */
4038 public function __construct ()
4139 {
42- $ http_method = filter_input (INPUT_SERVER , 'REQUEST_METHOD ' , FILTER_SANITIZE_STRING );
40+ $ http_method = empty ($ _SERVER ['REQUEST_METHOD ' ]) ? null : $ _SERVER ['REQUEST_METHOD ' ];
41+ $ is_post = is_string ($ http_method ) && strtoupper ($ http_method ) === 'POST ' ;
42+ $ request = $ is_post ? array_merge ($ _GET , $ _POST ) : $ _REQUEST ;
4343
44- $ request = strtoupper ($ http_method ) === 'POST ' ? array_merge ($ _GET , $ _POST ) : $ _GET ;
4544 $ this ->context = new ArrayContext ($ request );
4645 }
4746
You can’t perform that action at this time.
0 commit comments