Skip to content

Commit 3b39f26

Browse files
committed
use array check
1 parent d8c7a4b commit 3b39f26

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

system/Database/Forge.php

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

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

@@ -766,9 +764,11 @@ public function modifyColumn(string $table, $field): bool
766764
return false;
767765
}
768766

769-
foreach ($sqls as $sql) {
770-
if ($this->db->query($sql) === false) {
771-
return false;
767+
if (is_array($sqls)) {
768+
foreach ($sqls as $sql) {
769+
if ($this->db->query($sql) === false) {
770+
return false;
771+
}
772772
}
773773
}
774774

0 commit comments

Comments
 (0)