From bd11bc16c7ac1b797e72387a9d3743fee4f44137 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 4 Oct 2017 11:42:01 +0100 Subject: [PATCH] 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 --- src/Control/Director.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Control/Director.php b/src/Control/Director.php index 109135cf1..2514e155b 100644 --- a/src/Control/Director.php +++ b/src/Control/Director.php @@ -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