Skip to content

Commit d8c7a4b

Browse files
committed
use array check
1 parent 0e598d1 commit d8c7a4b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

system/Database/Forge.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,9 +704,11 @@ public function addColumn(string $table, $field): bool
704704
return false;
705705
}
706706

707-
foreach ($sqls as $sql) {
708-
if ($this->db->query($sql) === false) {
709-
return false;
707+
if (is_array($sqls)) {
708+
foreach ($sqls as $sql) {
709+
if ($this->db->query($sql) === false) {
710+
return false;
711+
}
710712
}
711713
}
712714

0 commit comments

Comments
 (0)