summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-03-30 15:16:33 +0200
committerGitHub <noreply@github.com>2017-03-30 15:16:33 +0200
commita51e4dd2591b8c264846e7811605dd3f5d7a5c55 (patch)
tree00738d1e52e5e1defd3ecd5639890b520606ddcb /lib
parent0fb7c631cef8824d39673de5ce5add5128c0e612 (diff)
parent0aeb5957840866e77391809f16999222dbb0b12a (diff)
downloadnextcloud-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.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;
}