Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion lib/private/Cache/CappedMemoryCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ public function get($key) {
}

public function set($key, $value, $ttl = 0) {
$this->cache[$key] = $value;
if (is_null($key)) {
$this->cache[] = $value;
} else {
$this->cache[$key] = $value;
}
$this->garbageCollect();
}

Expand Down
3 changes: 2 additions & 1 deletion lib/private/User/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,10 @@ public function checkPassword($uid, $password) {
* @return boolean true if user was found, false otherwise
*/
private function loadUser($uid) {
$uid = (string) $uid;
if (!isset($this->cache[$uid])) {
//guests $uid could be NULL or ''
if ($uid === null || $uid === '') {
if ($uid === '') {
$this->cache[$uid]=false;
return true;
}
Expand Down