aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-10-21 12:07:00 +0200
committerGitHub <noreply@github.com>2019-10-21 12:07:00 +0200
commit2905e8d6cf9979c54fe9f0ca88f21f291ec7d4ea (patch)
tree8624dd5406a88295a644026229b2f027801f7b70 /apps
parent8d094920c3fa8462ee42ad77138845098bd96a23 (diff)
parent512eb14d946167ab1ba2b7c25b40b2a4367aaaca (diff)
downloadnextcloud-server-2905e8d6cf9979c54fe9f0ca88f21f291ec7d4ea.tar.gz
nextcloud-server-2905e8d6cf9979c54fe9f0ca88f21f291ec7d4ea.zip
Merge pull request #17593 from nextcloud/ensure-valid-theming-image-route
make sure that the urls for theming images are valid
Diffstat (limited to 'apps')
-rw-r--r--apps/theming/lib/ThemingDefaults.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php
index 8e65fafe850..ec96889fdeb 100644
--- a/apps/theming/lib/ThemingDefaults.php
+++ b/apps/theming/lib/ThemingDefaults.php
@@ -334,11 +334,12 @@ class ThemingDefaults extends \OC_Defaults {
$customFavicon = null;
}
+ $route = false;
if ($image === 'favicon.ico' && ($customFavicon !== null || $this->imageManager->shouldReplaceIcons())) {
- return $this->urlGenerator->linkToRoute('theming.Icon.getFavicon', ['app' => $app]) . '?v=' . $cacheBusterValue;
+ $route = $this->urlGenerator->linkToRoute('theming.Icon.getFavicon', ['app' => $app]);
}
if ($image === 'favicon-touch.png' && ($customFavicon !== null || $this->imageManager->shouldReplaceIcons())) {
- return $this->urlGenerator->linkToRoute('theming.Icon.getTouchIcon', ['app' => $app]) . '?v=' . $cacheBusterValue;
+ $route = $this->urlGenerator->linkToRoute('theming.Icon.getTouchIcon', ['app' => $app]);
}
if ($image === 'manifest.json') {
try {
@@ -347,11 +348,16 @@ class ThemingDefaults extends \OC_Defaults {
return false;
}
} catch (AppPathNotFoundException $e) {}
- return $this->urlGenerator->linkToRoute('theming.Theming.getManifest') . '?v=' . $cacheBusterValue;
+ $route = $this->urlGenerator->linkToRoute('theming.Theming.getManifest');
}
if (strpos($image, 'filetypes/') === 0 && file_exists(\OC::$SERVERROOT . '/core/img/' . $image )) {
- return $this->urlGenerator->linkToRoute('theming.Icon.getThemedIcon', ['app' => $app, 'image' => $image]);
+ $route = $this->urlGenerator->linkToRoute('theming.Icon.getThemedIcon', ['app' => $app, 'image' => $image]);
}
+
+ if ($route) {
+ return $route . '?v=' . $cacheBusterValue;
+ }
+
return false;
}