summaryrefslogtreecommitdiffstats
path: root/apps/theming
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-03-28 12:24:51 +0200
committerJulius Härtl <jus@bitgrid.net>2018-04-19 20:14:40 +0200
commit7f9dabd984282c1ed5d62132c6137a8e88dea925 (patch)
tree97e7dd04efd3dd01891067587732ea4552b72151 /apps/theming
parent39f44e1452c67b1b3da5a85c89d3fc3856d19ab8 (diff)
downloadnextcloud-server-7f9dabd984282c1ed5d62132c6137a8e88dea925.tar.gz
nextcloud-server-7f9dabd984282c1ed5d62132c6137a8e88dea925.zip
Make sure the custom favicon is used
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/theming')
-rw-r--r--apps/theming/lib/ThemingDefaults.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php
index 03d5a3f061e..2e6b667b1f6 100644
--- a/apps/theming/lib/ThemingDefaults.php
+++ b/apps/theming/lib/ThemingDefaults.php
@@ -270,10 +270,16 @@ class ThemingDefaults extends \OC_Defaults {
}
$cacheBusterValue = $this->config->getAppValue('theming', 'cachebuster', '0');
- if ($image === 'favicon.ico' && $this->shouldReplaceIcons()) {
+ try {
+ $customFavicon = $this->imageManager->getImage('favicon');
+ } catch (NotFoundException $e) {
+ $customFavicon = null;
+ }
+
+ if ($image === 'favicon.ico' && ($customFavicon !== null || $this->shouldReplaceIcons())) {
return $this->urlGenerator->linkToRoute('theming.Icon.getFavicon', ['app' => $app]) . '?v=' . $cacheBusterValue;
}
- if ($image === 'favicon-touch.png' && $this->shouldReplaceIcons()) {
+ if ($image === 'favicon-touch.png' && ($customFavicon !== null || $this->shouldReplaceIcons())) {
return $this->urlGenerator->linkToRoute('theming.Icon.getTouchIcon', ['app' => $app]) . '?v=' . $cacheBusterValue;
}
if ($image === 'manifest.json') {
@@ -318,6 +324,8 @@ class ThemingDefaults extends \OC_Defaults {
$cacheBusterKey = $this->config->getAppValue('theming', 'cachebuster', '0');
$this->config->setAppValue('theming', 'cachebuster', (int)$cacheBusterKey+1);
$this->cacheFactory->createDistributed('theming-')->clear();
+ $this->cacheFactory->createDistributed('imagePath')->clear();
+
}
/**