diff options
author | Julius Härtl <jus@bitgrid.net> | 2018-05-08 14:06:31 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2018-06-05 17:47:38 +0300 |
commit | d132527aa9c4baad344b11adef3a6f4a46cde3ab (patch) | |
tree | 701700d4dae0dd2c8b7a7ef7637f9f05e81fa49f /apps/theming/lib/Controller | |
parent | 9b919245f67f5511d6be7910f61d639b290eab26 (diff) |
Use svg opt out as parameter
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/theming/lib/Controller')
-rw-r--r-- | apps/theming/lib/Controller/ThemingController.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php index f3a7f8cfcc5..7f2130ecbb8 100644 --- a/apps/theming/lib/Controller/ThemingController.php +++ b/apps/theming/lib/Controller/ThemingController.php @@ -358,12 +358,13 @@ class ThemingController extends Controller { * @NoCSRFRequired * * @param string $key + * @param bool $useSvg * @return FileDisplayResponse|NotFoundResponse - * @throws \Exception + * @throws NotPermittedException */ - public function getImage(string $key, bool $asPng = false) { + public function getImage(string $key, bool $useSvg = true) { try { - $file = $this->imageManager->getImage($key, $asPng); + $file = $this->imageManager->getImage($key, $useSvg); } catch (NotFoundException $e) { return new NotFoundResponse(); } @@ -372,7 +373,7 @@ class ThemingController extends Controller { $response->cacheFor(3600); $response->addHeader('Content-Type', $this->config->getAppValue($this->appName, $key . 'Mime', '')); $response->addHeader('Content-Disposition', 'attachment; filename="' . $key . '"'); - if ($asPng) { + if (!$useSvg) { $response->addHeader('Content-Type', 'image/png'); } else { $response->addHeader('Content-Type', $this->config->getAppValue($this->appName, $key . 'Mime', '')); |