fix: Remove useless static property in OCP\Util

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2026-03-13 10:44:31 +01:00
parent 5961eba6a1
commit 3fcb3a962d
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A

View file

@ -412,24 +412,13 @@ class Util {
return \OC_Hook::emit($signalclass, $signalname, $params);
}
/**
* Cached encrypted CSRF token. Some static unit-tests of ownCloud compare
* multiple Template elements which invoke `callRegister`. If the value
* would not be cached these unit-tests would fail.
* @var string
*/
private static $token = '';
/**
* Register an get/post call. This is important to prevent CSRF attacks
* @since 4.5.0
* @deprecated 32.0.0 directly use CsrfTokenManager instead
*/
public static function callRegister() {
if (self::$token === '') {
self::$token = \OCP\Server::get(CsrfTokenManager::class)->getToken()->getEncryptedValue();
}
return self::$token;
return \OCP\Server::get(CsrfTokenManager::class)->getToken()->getEncryptedValue();
}
/**