diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-04-27 10:58:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-27 10:58:34 +0200 |
commit | 9b7e24a7a1c1059c7f2a0568b2d5c29f512618f8 (patch) | |
tree | 423ff5692fa16e047b2a8a608d6b1e27ea64d613 /core | |
parent | 3c5c4caa4da7fee700ba683bb75e3b8aa7c1b190 (diff) | |
parent | d766d09f01314c5db7dc54288884edb6a159321e (diff) | |
download | nextcloud-server-9b7e24a7a1c1059c7f2a0568b2d5c29f512618f8.tar.gz nextcloud-server-9b7e24a7a1c1059c7f2a0568b2d5c29f512618f8.zip |
Merge pull request #19084 from nextcloud/bug/13556/wrong-paths-for-svg
Make it possible to resolve svg's outside \OC::$SERVERROOT
Diffstat (limited to 'core')
-rw-r--r-- | core/Controller/SvgController.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/core/Controller/SvgController.php b/core/Controller/SvgController.php index ba0e77602f2..af71ca17330 100644 --- a/core/Controller/SvgController.php +++ b/core/Controller/SvgController.php @@ -32,6 +32,7 @@ declare(strict_types=1); namespace OC\Core\Controller; use OC\Template\IconsCacher; +use OCP\App\AppPathNotFoundException; use OCP\App\IAppManager; use OCP\AppFramework\Controller; use OCP\AppFramework\Http; @@ -97,13 +98,13 @@ class SvgController extends Controller { * @return DataDisplayResponse|NotFoundResponse */ public function getSvgFromApp(string $app, string $fileName, string $color = 'ffffff') { - $appRootPath = $this->appManager->getAppPath($app); - $appPath = substr($appRootPath, strlen($this->serverRoot)); - - if (!$appPath) { + try { + $appPath = $this->appManager->getAppPath($app); + } catch (AppPathNotFoundException $e) { return new NotFoundResponse(); } - $path = $this->serverRoot . $appPath ."/img/$fileName.svg"; + + $path = $appPath . "/img/$fileName.svg"; return $this->getSvg($path, $color, $fileName); } |