Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'apps/theming/lib/Controller/IconController.php')
-rw-r--r--apps/theming/lib/Controller/IconController.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/theming/lib/Controller/IconController.php b/apps/theming/lib/Controller/IconController.php
index da6668c4906..45d3ee14e47 100644
--- a/apps/theming/lib/Controller/IconController.php
+++ b/apps/theming/lib/Controller/IconController.php
@@ -107,7 +107,7 @@ class IconController extends Controller {
* @NoCSRFRequired
*
* @param $app string app name
- * @return FileDisplayResponse|DataDisplayResponse
+ * @return FileDisplayResponse|DataDisplayResponse|NotFoundResponse
* @throws \Exception
*/
public function getFavicon(string $app = 'core'): Response {
@@ -123,6 +123,9 @@ class IconController extends Controller {
$iconFile = $this->imageManager->getCachedImage('favIcon-' . $app);
} catch (NotFoundException $exception) {
$icon = $this->iconBuilder->getFavicon($app);
+ if ($icon === false || $icon === '') {
+ return new NotFoundResponse();
+ }
$iconFile = $this->imageManager->setCachedImage('favIcon-' . $app, $icon);
}
$response = new FileDisplayResponse($iconFile, Http::STATUS_OK, ['Content-Type' => 'image/x-icon']);
@@ -142,7 +145,7 @@ class IconController extends Controller {
* @NoCSRFRequired
*
* @param $app string app name
- * @return DataDisplayResponse|FileDisplayResponse
+ * @return DataDisplayResponse|FileDisplayResponse|NotFoundResponse
* @throws \Exception
*/
public function getTouchIcon(string $app = 'core'): Response {
@@ -157,6 +160,9 @@ class IconController extends Controller {
$iconFile = $this->imageManager->getCachedImage('touchIcon-' . $app);
} catch (NotFoundException $exception) {
$icon = $this->iconBuilder->getTouchIcon($app);
+ if ($icon === false || $icon === '') {
+ return new NotFoundResponse();
+ }
$iconFile = $this->imageManager->setCachedImage('touchIcon-' . $app, $icon);
}
$response = new FileDisplayResponse($iconFile, Http::STATUS_OK, ['Content-Type' => 'image/png']);