aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/private/Cache/CappedMemoryCache.php6
-rw-r--r--lib/private/User/Database.php3
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/Cache/CappedMemoryCache.php b/lib/private/Cache/CappedMemoryCache.php
index c6b45c49c1c..2e180cfb013 100644
--- a/lib/private/Cache/CappedMemoryCache.php
+++ b/lib/private/Cache/CappedMemoryCache.php
@@ -47,7 +47,11 @@ class CappedMemoryCache implements ICache, \ArrayAccess {
}
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();
}
diff --git a/lib/private/User/Database.php b/lib/private/User/Database.php
index 22b335ebfbd..73506c7d7c5 100644
--- a/lib/private/User/Database.php
+++ b/lib/private/User/Database.php
@@ -237,9 +237,10 @@ class Database extends Backend implements IUserBackend {
* @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;
}