From 06f03e33415cdc5e0317351963cc487373a156d4 Mon Sep 17 00:00:00 2001 From: silentworks Date: Wed, 30 Oct 2013 23:45:51 +0000 Subject: [PATCH] Fix urlFor adding extra slashes on Windows OS #663 --- Slim/Environment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Slim/Environment.php b/Slim/Environment.php index e43877e83..85d2d9a17 100644 --- a/Slim/Environment.php +++ b/Slim/Environment.php @@ -135,7 +135,7 @@ private function __construct($settings = null) if (strpos($requestUri, $scriptName) !== false) { $physicalPath = $scriptName; // <-- Without rewriting } else { - $physicalPath = dirname($scriptName); // <-- With rewriting + $physicalPath = ltrim(dirname($scriptName), '\\'); // <-- With rewriting } $env['SCRIPT_NAME'] = rtrim($physicalPath, '/'); // <-- Remove trailing slashes