diff options
author | Loki3000 <github@labcms.ru> | 2017-01-10 13:09:33 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-10 13:09:33 +0300 |
commit | b0ff59d42ffae792a0642ad064e035320f7bc5cb (patch) | |
tree | 5612f025591a20341359e68092accf0539de0238 /lib | |
parent | 33259b41cd45fa129004c4565405d671e435087f (diff) | |
download | nextcloud-server-b0ff59d42ffae792a0642ad064e035320f7bc5cb.tar.gz nextcloud-server-b0ff59d42ffae792a0642ad064e035320f7bc5cb.zip |
remove non required db requests
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/User/Database.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/User/Database.php b/lib/private/User/Database.php index 69826f49be3..dccdb790145 100644 --- a/lib/private/User/Database.php +++ b/lib/private/User/Database.php @@ -75,7 +75,6 @@ class Database extends Backend implements IUserBackend { */ public function __construct($eventDispatcher = null) { $this->cache = new CappedMemoryCache(); - $this->cache[null] = false; $this->eventDispatcher = $eventDispatcher ? $eventDispatcher : \OC::$server->getEventDispatcher(); } @@ -239,6 +238,12 @@ class Database extends Backend implements IUserBackend { */ private function loadUser($uid) { if (!isset($this->cache[$uid])) { + //guests $uid could be NULL or '' + if (empty($uid)) { + $this->cache[$uid]=false; + return true; + } + $query = \OC_DB::prepare('SELECT `uid`, `displayname` FROM `*PREFIX*users` WHERE LOWER(`uid`) = LOWER(?)'); $result = $query->execute(array($uid)); |