Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Hash cache key
Signed-off-by: Christopher Ng <[email protected]>
  • Loading branch information
Pytal authored and backportbot[bot] committed Aug 18, 2021
commit 7aa75c7b5ef4146e75539bcc432b074b9c9661af
5 changes: 3 additions & 2 deletions lib/private/User/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function get($uid) {
return $this->cachedUsers[$uid];
}

$cachedBackend = $this->cache->get($uid);
$cachedBackend = $this->cache->get(sha1($uid));
if ($cachedBackend !== null && isset($this->backends[$cachedBackend])) {
// Cache has the info of the user backend already, so ask that one directly
$backend = $this->backends[$cachedBackend];
Expand All @@ -175,7 +175,8 @@ public function get($uid) {
}

if ($backend->userExists($uid)) {
$this->cache->set($uid, $i, 300);
// Hash $uid to ensure that only valid characters are used for the cache key
$this->cache->set(sha1($uid), $i, 300);
return $this->getUserObject($uid, $backend);
}
}
Expand Down