$prefixtouse = '';
}
/// Get the name
- $tablename = $this->prefix . $xmldb_table->getName();
+ $tablename = $prefixtouse . $xmldb_table->getName();
/// Apply quotes conditionally
if ($quoted) {
$tablename = $this->getEncQuoted($tablename);
if (!$xmldb_fields = $xmldb_table->getFields()) {
return false;
}
+
+ /// Prevent tables without prefix to be duplicated (part of MDL-6614)
+ if (in_array($xmldb_table->getName(), $this->getTablesWithoutPrefix()) &&
+ table_exists($xmldb_table)) {
+ return false;
+ }
+
/// Add the fields, separated by commas
foreach ($xmldb_fields as $xmldb_field) {
$table .= "\n " . $this->getFieldSQL($xmldb_field);