From 8a8ef211c8c7477cf2de0a3e867c52a87770a4e8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Fri, 21 Dec 2018 17:37:29 +0100 Subject: [PATCH] Use only app path to get the icon on the svg api MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- core/Controller/SvgController.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/Controller/SvgController.php b/core/Controller/SvgController.php index 1fad9c39c3b..fc34ac4d41d 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); } -- 2.39.5