summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-04-24 14:23:50 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-04-24 14:23:50 +0200
commit81f71cb1f921c777087dc663c4b87a29483ff10f (patch)
treedd59ea2536cdfd543d18d790d7ae8afd91bbbc08
parent074a0e0665a4e149177809dc2c9d3fc625e4de0f (diff)
downloadnextcloud-server-81f71cb1f921c777087dc663c4b87a29483ff10f.tar.gz
nextcloud-server-81f71cb1f921c777087dc663c4b87a29483ff10f.zip
Numeric only uids are no fun
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
-rw-r--r--lib/private/User/Database.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/User/Database.php b/lib/private/User/Database.php
index 4d9bb15affa..001e0c0f4a5 100644
--- a/lib/private/User/Database.php
+++ b/lib/private/User/Database.php
@@ -222,6 +222,7 @@ class Database extends ABackend
* @return string display name
*/
public function getDisplayName($uid): string {
+ $uid = (string)$uid;
$this->loadUser($uid);
return empty($this->cache[$uid]['displayname']) ? $uid : $this->cache[$uid]['displayname'];
}
@@ -357,7 +358,9 @@ class Database extends ABackend
*/
public function getUsers($search = '', $limit = null, $offset = null) {
$users = $this->getDisplayNames($search, $limit, $offset);
- $userIds = array_keys($users);
+ $userIds = array_map(function ($uid) {
+ return (string)$uid;
+ }, array_keys($users));
sort($userIds, SORT_STRING | SORT_FLAG_CASE);
return $userIds;
}