Skip to content

Commit 1e8e5c9

Browse files
authored
Merge pull request #2205 from MGatner/forge-prefix-trim
Fix empty() bug on DBPrefix
2 parents a29fb7f + df9e369 commit 1e8e5c9

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

system/Database/Forge.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ public function dropTable(string $tableName, bool $ifExists = false, bool $casca
605605
}
606606

607607
// If the prefix is already starting the table name, remove it...
608-
if (! empty($this->db->DBPrefix) && strpos($tableName, $this->db->DBPrefix) === 0)
608+
if ($this->db->DBPrefix && strpos($tableName, $this->db->DBPrefix) === 0)
609609
{
610610
$tableName = substr($tableName, strlen($this->db->DBPrefix));
611611
}

system/Test/CIDatabaseTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ protected function setUp()
173173
{
174174
$this->migrations->setNamespace($this->namespace);
175175
}
176+
$this->migrations->regress(0, 'tests');
176177

177178
// Delete all of the tables to ensure we're at a clean start.
178179
$tables = $this->db->listTables();
@@ -192,7 +193,6 @@ protected function setUp()
192193
}
193194
}
194195

195-
$this->migrations->regress(0, 'tests');
196196
$this->migrations->latest('tests');
197197
}
198198

0 commit comments

Comments
 (0)