diff options
author | Julius Härtl <jus@bitgrid.net> | 2017-06-15 22:14:39 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2017-06-16 10:51:37 +0200 |
commit | 517dfdda0dfe928836e32db2dfffe04545abfe8e (patch) | |
tree | fa31b272e1ae383b13444c7954bdf38186bffd35 /lib/private | |
parent | f039ba748032a78e70845adad9152730715a8219 (diff) | |
download | nextcloud-server-517dfdda0dfe928836e32db2dfffe04545abfe8e.tar.gz nextcloud-server-517dfdda0dfe928836e32db2dfffe04545abfe8e.zip |
Fix theming app to also use the prefix
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Template/SCSSCacher.php | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/private/Template/SCSSCacher.php b/lib/private/Template/SCSSCacher.php index eccc65a5cc9..fe5a095c773 100644 --- a/lib/private/Template/SCSSCacher.php +++ b/lib/private/Template/SCSSCacher.php @@ -92,7 +92,7 @@ class SCSSCacher { $path = explode('/', $root . '/' . $file); $fileNameSCSS = array_pop($path); - $fileNameCSS = $this->getBaseUrlHash() . '-' . str_replace('.scss', '.css', $fileNameSCSS); + $fileNameCSS = $this->prependBaseurlPrefix(str_replace('.scss', '.css', $fileNameSCSS)); $path = implode('/', $path); @@ -119,7 +119,7 @@ class SCSSCacher { */ public function getCachedCSS($appName, $fileName) { $folder = $this->appData->getFolder($appName); - return $folder->getFile($fileName); + return $folder->getFile($this->prependBaseurlPrefix($fileName)); } /** @@ -292,12 +292,17 @@ class SCSSCacher { public function getCachedSCSS($appName, $fileName) { $tmpfileLoc = explode('/', $fileName); $fileName = array_pop($tmpfileLoc); - $fileName = $this->getBaseUrlHash() . '-' . str_replace('.scss', '.css', $fileName); + $fileName = $this->prependBaseurlPrefix(str_replace('.scss', '.css', $fileName)); return substr($this->urlGenerator->linkToRoute('core.Css.getCss', array('fileName' => $fileName, 'appName' => $appName)), strlen(\OC::$WEBROOT) + 1); } - private function getBaseUrlHash() { - return md5($this->urlGenerator->getBaseUrl()); + /** + * Prepend hashed base url to the css file + * @param $cssFile + * @return string + */ + private function prependBaseurlPrefix($cssFile) { + return md5($this->urlGenerator->getBaseUrl()) . '-' . $cssFile; } } |