aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2013-03-19 12:35:31 +0100
committerThomas Tanghus <thomas@tanghus.net>2013-03-19 12:35:31 +0100
commit57f2884efaafaf3dbadf5c9399ac31f7ecc00a1e (patch)
tree3b11c472c502b7e80fe1050c2a73e5f6e92d75f3
parent5902ba5c2b64e1050c8137759f14de4272adb707 (diff)
downloadnextcloud-server-57f2884efaafaf3dbadf5c9399ac31f7ecc00a1e.tar.gz
nextcloud-server-57f2884efaafaf3dbadf5c9399ac31f7ecc00a1e.zip
Add hashed version parameter to js and css. Ref #1520 and many more ;)
-rw-r--r--lib/templatelayout.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/templatelayout.php b/lib/templatelayout.php
index 29f120a6041..225830704a9 100644
--- a/lib/templatelayout.php
+++ b/lib/templatelayout.php
@@ -37,6 +37,7 @@ class OC_TemplateLayout extends OC_Template {
} else {
parent::__construct('core', 'layout.base');
}
+ $versionParameter = '?' . md5(implode(OC_Util::getVersion()));
// Add the js files
$jsfiles = self::findJavascriptFiles(OC_Util::$scripts);
$this->assign('jsfiles', array(), false);
@@ -44,20 +45,20 @@ class OC_TemplateLayout extends OC_Template {
$this->append( 'jsfiles', OC_Helper::linkToRoute('js_config'));
}
if (!empty(OC_Util::$core_scripts)) {
- $this->append( 'jsfiles', OC_Helper::linkToRemoteBase('core.js', false));
+ $this->append( 'jsfiles', OC_Helper::linkToRemoteBase('core.js', false) . $versionParameter);
}
foreach($jsfiles as $info) {
$root = $info[0];
$web = $info[1];
$file = $info[2];
- $this->append( 'jsfiles', $web.'/'.$file);
+ $this->append( 'jsfiles', $web.'/'.$file . $versionParameter);
}
// Add the css files
$cssfiles = self::findStylesheetFiles(OC_Util::$styles);
$this->assign('cssfiles', array());
if (!empty(OC_Util::$core_styles)) {
- $this->append( 'cssfiles', OC_Helper::linkToRemoteBase('core.css', false));
+ $this->append( 'cssfiles', OC_Helper::linkToRemoteBase('core.css', false) . $versionParameter);
}
foreach($cssfiles as $info) {
$root = $info[0];
@@ -77,7 +78,7 @@ class OC_TemplateLayout extends OC_Template {
$app = $paths[0];
unset($paths[0]);
$path = implode('/', $paths);
- $this->append( 'cssfiles', OC_Helper::linkTo($app, $path));
+ $this->append( 'cssfiles', OC_Helper::linkTo($app, $path) . $versionParameter);
}
else {
$this->append( 'cssfiles', $web.'/'.$file);