summaryrefslogtreecommitdiffstats
path: root/lib/private/Template
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2017-06-15 22:14:39 +0200
committerJulius Härtl <jus@bitgrid.net>2017-06-16 10:51:37 +0200
commit517dfdda0dfe928836e32db2dfffe04545abfe8e (patch)
treefa31b272e1ae383b13444c7954bdf38186bffd35 /lib/private/Template
parentf039ba748032a78e70845adad9152730715a8219 (diff)
downloadnextcloud-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/Template')
-rw-r--r--lib/private/Template/SCSSCacher.php15
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;
}
}