From 5fbadee95ff11429739dc7cf818d93d0c549a73f Mon Sep 17 00:00:00 2001 From: Julius Haertl Date: Fri, 9 Dec 2016 12:44:01 +0100 Subject: [PATCH] Check if image files for theming are empty Signed-off-by: Julius Haertl --- apps/theming/lib/Controller/IconController.php | 3 +++ apps/theming/lib/IconBuilder.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/theming/lib/Controller/IconController.php b/apps/theming/lib/Controller/IconController.php index 4c25d911e5..7c4e209d0d 100644 --- a/apps/theming/lib/Controller/IconController.php +++ b/apps/theming/lib/Controller/IconController.php @@ -94,6 +94,9 @@ class IconController extends Controller { $iconFile = $this->imageManager->getCachedImage("icon-" . $app . '-' . str_replace("/","_",$image)); } catch (NotFoundException $exception) { $icon = $this->iconBuilder->colorSvg($app, $image); + if ($icon === false || $icon === "") { + return new NotFoundResponse(); + } $iconFile = $this->imageManager->setCachedImage("icon-" . $app . '-' . str_replace("/","_",$image), $icon); } if ($iconFile !== false) { diff --git a/apps/theming/lib/IconBuilder.php b/apps/theming/lib/IconBuilder.php index 9cf0d05130..205ee3a89a 100644 --- a/apps/theming/lib/IconBuilder.php +++ b/apps/theming/lib/IconBuilder.php @@ -172,7 +172,7 @@ class IconBuilder { return false; } $svg = file_get_contents($imageFile); - if ($svg !== false) { + if ($svg !== false && $svg !== "") { $color = $this->util->elementColor($this->themingDefaults->getMailHeaderColor()); $svg = $this->util->colorizeSvg($svg, $color); return $svg;