diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-07-04 10:04:38 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2018-07-19 08:16:58 +0200 |
commit | 9e5885963c5dc09c20183732f0f94ca01598530e (patch) | |
tree | 92a3d5d2e9707644ec9c6b68ce0d3fe6d1f7165e /core/Controller | |
parent | 8977c71f8842f19077fdd0bfe27a4f48f2bc4726 (diff) | |
download | nextcloud-server-9e5885963c5dc09c20183732f0f94ca01598530e.tar.gz nextcloud-server-9e5885963c5dc09c20183732f0f94ca01598530e.zip |
Fixed icons detection and caching
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'core/Controller')
-rw-r--r-- | core/Controller/SvgController.php | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/core/Controller/SvgController.php b/core/Controller/SvgController.php index 4d71152f547..b1a78752c41 100644 --- a/core/Controller/SvgController.php +++ b/core/Controller/SvgController.php @@ -31,7 +31,6 @@ use OCP\AppFramework\Http\NotFoundResponse; use OCP\AppFramework\Utility\ITimeFactory; use OCP\Files\NotFoundException; use OCP\IRequest; -use OC\Template\IconsCacher; class SvgController extends Controller { @@ -41,18 +40,13 @@ class SvgController extends Controller { /** @var ITimeFactory */ protected $timeFactory; - /** @var IconsCacher */ - protected $iconsCacher; - public function __construct(string $appName, IRequest $request, - ITimeFactory $timeFactory, - IconsCacher $iconsCacher) { + ITimeFactory $timeFactory) { parent::__construct($appName, $request); $this->serverRoot = \OC::$SERVERROOT; $this->timeFactory = $timeFactory; - $this->iconsCacher = $iconsCacher; } /** @@ -68,7 +62,7 @@ class SvgController extends Controller { */ public function getSvgFromCore(string $folder, string $fileName, string $color = 'ffffff') { $path = $this->serverRoot . "/core/img/$folder/$fileName.svg"; - return $this->getSvg($path, $color); + return $this->getSvg($path, $color, $fileName); } /** @@ -94,7 +88,7 @@ class SvgController extends Controller { return new NotFoundResponse(); } $path = $this->serverRoot . $appPath ."/img/$fileName.svg"; - return $this->getSvg($path, $color); + return $this->getSvg($path, $color, $fileName); } @@ -105,7 +99,7 @@ class SvgController extends Controller { * @param string $color * @return DataDisplayResponse|NotFoundException */ - private function getSvg(string $path, string $color) { + private function getSvg(string $path, string $color, string $fileName) { if (!file_exists($path)) { return new NotFoundResponse(); } |