diff options
author | Joas Schilling <coding@schilljs.com> | 2017-01-17 11:44:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-17 11:44:50 +0100 |
commit | ce973929e8ebcdd63d35198cd79b2505a0fc975f (patch) | |
tree | a9e1b736e0f0fe8ed389fd894e73f44b630c08e7 /lib | |
parent | 35b8f03c07569f727b2a9c3115fc117907ef7c55 (diff) | |
parent | ba3506c431707883f0419f4c2a789d0d473c0b7d (diff) | |
download | nextcloud-server-ce973929e8ebcdd63d35198cd79b2505a0fc975f.tar.gz nextcloud-server-ce973929e8ebcdd63d35198cd79b2505a0fc975f.zip |
Merge pull request #3075 from nils/debug-no-versionhash
Do not add version hash in debug mode
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/TemplateLayout.php | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index bc6a485ad43..2551f8417a5 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -157,7 +157,7 @@ class TemplateLayout extends \OC_Template { foreach($jsFiles as $info) { $web = $info[1]; $file = $info[2]; - $this->append( 'jsfiles', $web.'/'.$file . '?v=' . self::$versionHash); + $this->append( 'jsfiles', $web.'/'.$file . $this->getVersionHashSuffix() ); } // Add the css files and check if server is already installed to prevent @@ -179,13 +179,22 @@ class TemplateLayout extends \OC_Template { $file = $info[2]; if (substr($file, -strlen('print.css')) === 'print.css') { - $this->append( 'printcssfiles', $web.'/'.$file . '?v=' . self::$versionHash); + $this->append( 'printcssfiles', $web.'/'.$file . $this->getVersionHashSuffix() ); } else { - $this->append( 'cssfiles', $web.'/'.$file . '?v=' . self::$versionHash); + $this->append( 'cssfiles', $web.'/'.$file . $this->getVersionHashSuffix() ); } } } + protected function getVersionHashSuffix() { + if(\OC::$server->getConfig()->getSystemValue('debug', false)) { + // allows chrome workspace mapping in debug mode + return ""; + } + + return '?v=' . self::$versionHash; + } + /** * @param array $styles * @return array |