From 3a2f3ce1cc1e6322438e7b4cd49dca3163df5d1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Mon, 29 Jan 2024 21:08:25 +0100 Subject: [PATCH] Fix problem with cache key generation if the username contained an @ sign or any other special character This fixes issue #504 --- src/Services/Cache/UserCacheKeyGenerator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Services/Cache/UserCacheKeyGenerator.php b/src/Services/Cache/UserCacheKeyGenerator.php index be1b7ad6..ac5487a5 100644 --- a/src/Services/Cache/UserCacheKeyGenerator.php +++ b/src/Services/Cache/UserCacheKeyGenerator.php @@ -60,7 +60,7 @@ class UserCacheKeyGenerator return 'user$_'.User::ID_ANONYMOUS; } - //In the most cases we can just use the username (its unique) - return 'user_'.$user->getUsername().'_'.$locale; + //Use the unique user id and the locale to generate the key + return 'user_'.$user->getID().'_'.$locale; } }