Skip to content

Commit 10f3c7e

Browse files
committed
refactor: use str_contains() over strpos on Forge
1 parent a2c6db0 commit 10f3c7e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

system/Database/MySQLi/Forge.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ protected function _createTableAttributes(array $attributes): string
116116
}
117117
}
118118

119-
if ($this->db->charset !== '' && in_array(strpos($sql, 'CHARACTER SET'), [0, false], true) && in_array(strpos($sql, 'CHARSET'), [0, false], true)) {
119+
if ($this->db->charset !== '' && ! str_contains($sql, 'CHARACTER SET') && ! str_contains($sql, 'CHARSET')) {
120120
$sql .= ' DEFAULT CHARACTER SET = ' . $this->db->escapeString($this->db->charset);
121121
}
122122

123-
if ($this->db->DBCollat !== '' && in_array(strpos($sql, 'COLLATE'), [0, false], true)) {
123+
if ($this->db->DBCollat !== '' && ! str_contains($sql, 'COLLATE')) {
124124
$sql .= ' COLLATE = ' . $this->db->escapeString($this->db->DBCollat);
125125
}
126126

0 commit comments

Comments
 (0)