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>
This commit is contained in:
parent
1ceb081c9b
commit
074a0e0665
|
@ -258,7 +258,7 @@ class Database extends ABackend
|
||||||
$result = $query->execute();
|
$result = $query->execute();
|
||||||
$displayNames = [];
|
$displayNames = [];
|
||||||
while ($row = $result->fetch()) {
|
while ($row = $result->fetch()) {
|
||||||
$displayNames[$row['uid']] = $row['displayname'];
|
$displayNames[(string)$row['uid']] = (string)$row['displayname'];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $displayNames;
|
return $displayNames;
|
||||||
|
@ -296,7 +296,7 @@ class Database extends ABackend
|
||||||
if (!empty($newHash)) {
|
if (!empty($newHash)) {
|
||||||
$this->setPassword($uid, $password);
|
$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
|
// "uid" is primary key, so there can only be a single result
|
||||||
if ($row !== false) {
|
if ($row !== false) {
|
||||||
$this->cache[$uid]['uid'] = $row['uid'];
|
$this->cache[$uid]['uid'] = (string)$row['uid'];
|
||||||
$this->cache[$uid]['displayname'] = $row['displayname'];
|
$this->cache[$uid]['displayname'] = (string)$row['displayname'];
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue