Avoid double slash in Director mock URLs

They get faulty results when run through parse_url($url, PHP_URL_PATH)
which we started using in HTTPRequestBuilder
This commit is contained in:
Ingo Schommer 2017-10-04 11:42:01 +01:00 committed by Damian Mooyman
parent cea5cd1c3e
commit bd11bc16c7

View File

@ -255,7 +255,7 @@ class Director implements TemplateGlobalProvider
} else {
$newVars['_GET'] = [];
}
$newVars['_SERVER']['REQUEST_URI'] = Director::baseURL() . $url;
$newVars['_SERVER']['REQUEST_URI'] = Director::baseURL() . ltrim($url, '/');
$newVars['_REQUEST'] = array_merge($newVars['_GET'], $newVars['_POST']);
// Normalise vars