Skip to content

Commit

Permalink
Merge pull request #47099 from nextcloud/backport/47095/stable28
Browse files Browse the repository at this point in the history
[stable28] fix(theming): make cache buster depend on the app version
  • Loading branch information
AndyScherzinger authored Aug 8, 2024
2 parents 22fa192 + a23ab36 commit d90a456
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/theming/lib/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,12 +334,14 @@ public function getCacheBuster(): string {
if (!is_null($user)) {
$userId = $user->getUID();
}
$serverVersion = \OC_Util::getVersionString();
$themingAppVersion = $this->appManager->getAppVersion('theming');
$userCacheBuster = '';
if ($userId) {
$userCacheBusterValue = (int)$this->config->getUserValue($userId, 'theming', 'userCacheBuster', '0');
$userCacheBuster = $userId . '_' . $userCacheBusterValue;
}
$systemCacheBuster = $this->config->getAppValue('theming', 'cachebuster', '0');
return substr(sha1($userCacheBuster . $systemCacheBuster), 0, 8);
return substr(sha1($serverVersion . $themingAppVersion . $userCacheBuster . $systemCacheBuster), 0, 8);
}
}

0 comments on commit d90a456

Please sign in to comment.