$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);
*/
public function getCachedCSS($appName, $fileName) {
$folder = $this->appData->getFolder($appName);
- return $folder->getFile($fileName);
+ return $folder->getFile($this->prependBaseurlPrefix($fileName));
}
/**
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;
}
}