Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(theming): make cache buster depend on the app version
Signed-off-by: Richard Steinmetz <[email protected]>
  • Loading branch information
st3iny authored and backportbot[bot] committed Aug 7, 2024
commit a23ab367f03e727e5a14258309c941234f412f2a
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);
}
}