From 3fcb3a962d075cdbbc204817ecbbee84c519b7c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Fri, 13 Mar 2026 10:44:31 +0100 Subject: [PATCH] fix: Remove useless static property in OCP\Util MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/public/Util.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/lib/public/Util.php b/lib/public/Util.php index 0610460fc22..0ecfc95075b 100644 --- a/lib/public/Util.php +++ b/lib/public/Util.php @@ -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(); } /**