]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add cachebuster to favicons
authorJulius Haertl <jus@bitgrid.net>
Thu, 25 Aug 2016 14:19:22 +0000 (16:19 +0200)
committerJulius Haertl <jus@bitgrid.net>
Fri, 18 Nov 2016 09:23:23 +0000 (10:23 +0100)
Signed-off-by: Julius Haertl <jus@bitgrid.net>
lib/private/URLGenerator.php

index f8b79dedd8ec4081c36bf476dd8b0a93b5e32a9c..8290fcb13379a4c122275fd988b2f384bf63662f 100644 (file)
@@ -158,11 +158,13 @@ class URLGenerator implements IURLGenerator {
                // Check if the app is in the app folder
                $path = '';
                if(\OCP\App::isEnabled('theming') && $image === "favicon.ico") {
+                       $cacheBusterValue = $this->config->getAppValue('theming', 'cachebuster', '0');
                        if($app==="") { $app = "core"; }
-                       $path = $this->linkToRoute('theming.Icon.getFavicon', [ 'app' => $app ]);
+                       $path = $this->linkToRoute('theming.Icon.getFavicon', [ 'app' => $app ]) . '?v='. $cacheBusterValue;
                } elseif(\OCP\App::isEnabled('theming') && $image === "favicon-touch.png") {
+                       $cacheBusterValue = $this->config->getAppValue('theming', 'cachebuster', '0');
                        if($app==="") { $app = "core"; }
-                       $path = $this->linkToRoute('theming.Icon.getTouchIcon', [ 'app' => $app ]);
+                       $path = $this->linkToRoute('theming.Icon.getTouchIcon', [ 'app' => $app ]) . '?v='. $cacheBusterValue;
                } elseif (file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$app/img/$image")) {
                        $path = \OC::$WEBROOT . "/themes/$theme/apps/$app/img/$image";
                } elseif (!file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$app/img/$basename.svg")