Skip to content

Commit

Permalink
Merge pull request #10484 from nextcloud/bugfix/noid/theming-cache-up…
Browse files Browse the repository at this point in the history
…date

Append cache bump parameter to scss files URL
  • Loading branch information
rullzer authored Aug 1, 2018
2 parents e65ca39 + 6ce4745 commit b5c5fae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/private/Template/SCSSCacher.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,11 @@ public function getCachedSCSS(string $appName, string $fileName): string {
$fileName = array_pop($tmpfileLoc);
$fileName = $this->prependVersionPrefix($this->prependBaseurlPrefix(str_replace('.scss', '.css', $fileName)), $appName);

return substr($this->urlGenerator->linkToRoute('core.Css.getCss', ['fileName' => $fileName, 'appName' => $appName]), strlen(\OC::$WEBROOT) + 1);
return substr($this->urlGenerator->linkToRoute('core.Css.getCss', [
'fileName' => $fileName,
'appName' => $appName,
'v' => $this->config->getAppValue('core', 'scss.variables', '0')
]), \strlen(\OC::$WEBROOT) + 1);
}

/**
Expand Down
3 changes: 2 additions & 1 deletion tests/lib/Template/SCSSCacherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,8 @@ public function testGetCachedSCSS($appName, $fileName, $result, $version) {
->with('core.Css.getCss', [
'fileName' => substr(md5($version), 0, 4) . '-' .
substr(md5('http://localhost/nextcloud/index.php'), 0, 4) . '-styles.css',
'appName' => $appName
'appName' => $appName,
'v' => 0,
])
->willReturn(\OC::$WEBROOT . $result);
$actual = $this->scssCacher->getCachedSCSS($appName, $fileName);
Expand Down

0 comments on commit b5c5fae

Please sign in to comment.