diff options
author | Björn Schießle <bjoern@schiessle.org> | 2016-12-09 15:57:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-09 15:57:44 +0100 |
commit | d10be51d40ed3e2e99c3749e5f1ba7c72b4a2e6a (patch) | |
tree | 4a3443921be3eaf45885e64a3fd27a7662004d4c | |
parent | de8908bf29d1e23f1ce5a41fcde02e1bf588b1a4 (diff) | |
parent | 5fbadee95ff11429739dc7cf818d93d0c549a73f (diff) | |
download | nextcloud-server-d10be51d40ed3e2e99c3749e5f1ba7c72b4a2e6a.tar.gz nextcloud-server-d10be51d40ed3e2e99c3749e5f1ba7c72b4a2e6a.zip |
Merge pull request #2588 from nextcloud/theming-check-empty
Check if image files for theming are empty
-rw-r--r-- | apps/theming/lib/Controller/IconController.php | 3 | ||||
-rw-r--r-- | apps/theming/lib/IconBuilder.php | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/apps/theming/lib/Controller/IconController.php b/apps/theming/lib/Controller/IconController.php index 4c25d911e5e..7c4e209d0df 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 7134fb58cfc..39a7722f0a5 100644 --- a/apps/theming/lib/IconBuilder.php +++ b/apps/theming/lib/IconBuilder.php @@ -177,7 +177,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; |