Skip to content

Commit 528e125

Browse files
authored
Initialize $_SERVER['QUERY_STRING'] (#16)
* Initialize $_SERVER['QUERY_STRING'] * Apache/nginx use an empty string when no query string is set, the PHP internal webserver ommits the property. For now, we cast possible null values to an empty string.
1 parent 0e33d34 commit 528e125

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Codeception/Lib/Connector/Yii2.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ public function doRequest($request)
301301
$queryString = parse_url($uri, PHP_URL_QUERY);
302302
$_SERVER['REQUEST_URI'] = $queryString === null ? $pathString : $pathString . '?' . $queryString;
303303
$_SERVER['REQUEST_METHOD'] = strtoupper($request->getMethod());
304+
$_SERVER['QUERY_STRING'] = (string)$queryString;
304305

305306
parse_str($queryString, $params);
306307
foreach ($params as $k => $v) {

0 commit comments

Comments
 (0)