Merge pull request #13224 from nextcloud/stb14-svg-controller-fixes

[stable14] Use only app path to get the icon on the svg api
This commit is contained in:
John Molakvoæ 2019-01-03 17:53:53 +01:00 committed by GitHub
commit 9afb2ce843
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -89,13 +89,14 @@ class SvgController extends Controller {
return $this->getSvg($path, $color, $fileName); 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); $appRootPath = $this->appManager->getAppPath($app);
$appPath = substr($appRootPath, strlen($this->serverRoot));
if (!$appPath) { if (!$appRootPath) {
return new NotFoundResponse(); return new NotFoundResponse();
} }
$path = $this->serverRoot . $appPath ."/img/$fileName.svg"; $path = $appRootPath ."/img/$fileName.svg";
return $this->getSvg($path, $color, $fileName); return $this->getSvg($path, $color, $fileName);
} }