Use only app path to get the icon on the svg api

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2018-12-21 17:37:29 +01:00
parent b9628e74fc
commit 8a8ef211c8
No known key found for this signature in database
GPG key ID: 60C25B8C072916CF

View 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);
}