Skip to content

Commit

Permalink
Initialize $_SERVER['QUERY_STRING'] (Codeception#16)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
ebuzzz committed Oct 29, 2020
1 parent 0e33d34 commit 528e125
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Codeception/Lib/Connector/Yii2.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ public function doRequest($request)
$queryString = parse_url($uri, PHP_URL_QUERY);
$_SERVER['REQUEST_URI'] = $queryString === null ? $pathString : $pathString . '?' . $queryString;
$_SERVER['REQUEST_METHOD'] = strtoupper($request->getMethod());
$_SERVER['QUERY_STRING'] = (string)$queryString;

parse_str($queryString, $params);
foreach ($params as $k => $v) {
Expand Down

0 comments on commit 528e125

Please sign in to comment.