mirror of
https://github.com/friendica/friendica
synced 2025-04-22 00:30:10 +00:00
Ensure *toArray returns an array
This commit is contained in:
parent
b684fffcb7
commit
a61ce4fed0
3 changed files with 7 additions and 11 deletions
|
@ -1512,16 +1512,18 @@ class Database
|
|||
public function toArray($stmt, $do_close = true)
|
||||
{
|
||||
if (is_bool($stmt)) {
|
||||
return $stmt;
|
||||
return [];
|
||||
}
|
||||
|
||||
$data = [];
|
||||
while ($row = $this->fetch($stmt)) {
|
||||
$data[] = $row;
|
||||
}
|
||||
|
||||
if ($do_close) {
|
||||
$this->close($stmt);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue