Skip to content

Commit 332d6b1

Browse files
committed
RequestFactory: query is always taken from REQUEST_URI
In test was \x00 replaced with \x01 because of http_build_query limitation.
1 parent 5b27c17 commit 332d6b1

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/Http/RequestFactory.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,6 @@ public function createHttpRequest()
101101
$useFilter = (!in_array(ini_get('filter.default'), array('', 'unsafe_raw')) || ini_get('filter.default_flags'));
102102

103103
parse_str($url->getQuery(), $query);
104-
if (!$query) {
105-
$query = $useFilter ? filter_input_array(INPUT_GET, FILTER_UNSAFE_RAW) : (empty($_GET) ? array() : $_GET);
106-
}
107104
$post = $useFilter ? filter_input_array(INPUT_POST, FILTER_UNSAFE_RAW) : (empty($_POST) ? array() : $_POST);
108105
$cookies = $useFilter ? filter_input_array(INPUT_COOKIE, FILTER_UNSAFE_RAW) : (empty($_COOKIE) ? array() : $_COOKIE);
109106

tests/Http/Request.invalidEncoding.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ require __DIR__ . '/../bootstrap.php';
1313

1414
// Setup environment
1515
define('INVALID', "\xC4\x76\xC5\xBE");
16-
define('CONTROL_CHARACTERS', "A\x00B\x80C");
16+
define('CONTROL_CHARACTERS', "A\x01B\x80C");
1717

18-
$_GET = array(
18+
$_SERVER['REQUEST_URI'] = '/?' . http_build_query(array(
1919
'invalid' => INVALID,
2020
'control' => CONTROL_CHARACTERS,
2121
INVALID => '1',
2222
CONTROL_CHARACTERS => '1',
2323
'array' => array(INVALID => '1'),
24-
);
24+
));
2525

2626
$_POST = array(
2727
'invalid' => INVALID,

0 commit comments

Comments
 (0)