]> source.dussan.org Git - nextcloud-server.git/commitdiff
Use only app path to get the icon on the svg api 13224/head
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Fri, 21 Dec 2018 16:37:29 +0000 (17:37 +0100)
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Fri, 21 Dec 2018 16:37:29 +0000 (17:37 +0100)
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
core/Controller/SvgController.php

index 1fad9c39c3b383c903d65f21d127c74eff7c8d31..fc34ac4d41db3695b205614f232deff2af3f71c8 100644 (file)
@@ -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);
        }