fix(theming): make cache buster depend on the app version

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
pull/47095/head
Richard Steinmetz 2024-08-07 09:05:12 +07:00
parent fbbc10466b
commit 087f74806d
No known key found for this signature in database
GPG Key ID: 27137D9E7D273FB2
1 changed files with 3 additions and 1 deletions

@ -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);
}
}