diff options
author | Nils <git@to.nilsschnabel.de> | 2017-01-15 12:56:26 +0100 |
---|---|---|
committer | Nils <git@to.nilsschnabel.de> | 2017-01-15 13:29:32 +0100 |
commit | ba3506c431707883f0419f4c2a789d0d473c0b7d (patch) | |
tree | 452ccf1ddb11268f50fd91dddf4e1c0e9aa145f9 /lib/private | |
parent | c371e2f5323883a2056bb47ffafffd9b2c07f738 (diff) | |
download | nextcloud-server-ba3506c431707883f0419f4c2a789d0d473c0b7d.tar.gz nextcloud-server-ba3506c431707883f0419f4c2a789d0d473c0b7d.zip |
[Enhancement] Do not add version hash in debug mode
Signed-off-by: Nils <git@to.nilsschnabel.de>
Diffstat (limited to 'lib/private')
-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 |