MDL-32029 fix get_tables() when prefix empty in external database

This commit is contained in:
Petr Skoda
2012-03-24 11:36:01 +01:00
parent c856a1f60b
commit 62cd8cd9f5
5 changed files with 25 additions and 14 deletions
+5 -2
View File
@@ -152,10 +152,13 @@ class sqlite3_pdo_moodle_database extends pdo_moodle_database {
foreach ($rstables as $table) {
$table = $table['name'];
$table = strtolower($table);
if (empty($this->prefix) || strpos($table, $this->prefix) === 0) {
if ($this->prefix !== '') {
if (strpos($table, $this->prefix) !== 0) {
continue;
}
$table = substr($table, strlen($this->prefix));
$tables[$table] = $table;
}
$tables[$table] = $table;
}
return $tables;
}