diff options
author | Joas Schilling <coding@schilljs.com> | 2017-03-30 15:16:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-30 15:16:33 +0200 |
commit | a51e4dd2591b8c264846e7811605dd3f5d7a5c55 (patch) | |
tree | 00738d1e52e5e1defd3ecd5639890b520606ddcb /lib | |
parent | 0fb7c631cef8824d39673de5ce5add5128c0e612 (diff) | |
parent | 0aeb5957840866e77391809f16999222dbb0b12a (diff) | |
download | nextcloud-server-a51e4dd2591b8c264846e7811605dd3f5d7a5c55.tar.gz nextcloud-server-a51e4dd2591b8c264846e7811605dd3f5d7a5c55.zip |
Merge pull request #4150 from nextcloud/capped-memcache-push
support pushing to CappedMemoryCache
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Cache/CappedMemoryCache.php | 6 | ||||
-rw-r--r-- | lib/private/User/Database.php | 3 |
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; } |