diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-04-24 12:48:52 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-04-24 12:48:52 +0200 |
commit | 074a0e0665a4e149177809dc2c9d3fc625e4de0f (patch) | |
tree | 490b2f92d32bf167632e0a21ba2c4f6f7541cac8 /lib/private/User | |
parent | 1ceb081c9be32fd0bb6167171f7437852ab17207 (diff) | |
download | nextcloud-server-074a0e0665a4e149177809dc2c9d3fc625e4de0f.tar.gz nextcloud-server-074a0e0665a4e149177809dc2c9d3fc625e4de0f.zip |
Cast retrieved DB fields to string
Fixes #9279
If a pure numerical user is in the DB the value might be casted to a int
when returned. Cast it all to a string so we don't break the strict
typing.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/User')
-rw-r--r-- | lib/private/User/Database.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/User/Database.php b/lib/private/User/Database.php index bb6905b2695..4d9bb15affa 100644 --- a/lib/private/User/Database.php +++ b/lib/private/User/Database.php @@ -258,7 +258,7 @@ class Database extends ABackend $result = $query->execute(); $displayNames = []; while ($row = $result->fetch()) { - $displayNames[$row['uid']] = $row['displayname']; + $displayNames[(string)$row['uid']] = (string)$row['displayname']; } return $displayNames; @@ -296,7 +296,7 @@ class Database extends ABackend if (!empty($newHash)) { $this->setPassword($uid, $password); } - return $row['uid']; + return (string)$row['uid']; } } @@ -337,8 +337,8 @@ class Database extends ABackend // "uid" is primary key, so there can only be a single result if ($row !== false) { - $this->cache[$uid]['uid'] = $row['uid']; - $this->cache[$uid]['displayname'] = $row['displayname']; + $this->cache[$uid]['uid'] = (string)$row['uid']; + $this->cache[$uid]['displayname'] = (string)$row['displayname']; } else { return false; } |