Merge pull request #47095 from nextcloud/fix/theming/cache-buster-on-upgrade

fix(theming): make cache buster depend on the app version
This commit is contained in:
Richard Steinmetz 2024-08-07 10:24:44 +02:00 committed by GitHub
commit 5d577be6cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -311,12 +311,14 @@ class Util {
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);
}
}