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