diff --git a/core/Controller/SvgController.php b/core/Controller/SvgController.php index 1fad9c39c3..fc34ac4d41 100644 --- a/core/Controller/SvgController.php +++ b/core/Controller/SvgController.php @@ -89,13 +89,14 @@ class SvgController extends Controller { return $this->getSvg($path, $color, $fileName); } + // e.g /var/www/html/custom_apps/contacts + // or outside root /var/www/apps/files $appRootPath = $this->appManager->getAppPath($app); - $appPath = substr($appRootPath, strlen($this->serverRoot)); - if (!$appPath) { + if (!$appRootPath) { return new NotFoundResponse(); } - $path = $this->serverRoot . $appPath ."/img/$fileName.svg"; + $path = $appRootPath ."/img/$fileName.svg"; return $this->getSvg($path, $color, $fileName); }