diff --git a/Engine/Asset.php b/Engine/Asset.php index e68097f4c..abd497939 100644 --- a/Engine/Asset.php +++ b/Engine/Asset.php @@ -87,7 +87,7 @@ public function resolve(string $path): string { $publicDir = str_replace('\\', '/', $this->kernel->getProjectDir()) . '/public'; $basePath = $this->router->getContext()->getBaseUrl(); - $httpRootDir = str_replace($basePath, '', $publicDir); + $httpRootDir = substr($publicDir,0,-strlen($basePath)); // return immediately for straight asset paths $path = s($path);