Fixed possible missing leading slash in path

This commit is contained in:
Chris Kankiewicz
2020-01-27 14:42:28 -07:00
parent c0c179250c
commit 5fd030d5fc

View File

@@ -55,6 +55,6 @@ class StripBasePathMiddleware
{
$pattern = sprintf('/^%s/', preg_quote(dirname($_SERVER['SCRIPT_NAME']), '/'));
return preg_replace($pattern, '', $path);
return '/' . ltrim(preg_replace($pattern, '', $path), '/');
}
}