From 912ddd9ccf9db54480832441e1457a366412f7bd Mon Sep 17 00:00:00 2001 From: Platonides Date: Tue, 12 Apr 2011 18:52:16 +0000 Subject: [PATCH] Follow up r85888 --- includes/db/Database.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/db/Database.php b/includes/db/Database.php index 7bb13dfba7..1fc78ec379 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -1566,7 +1566,11 @@ abstract class DatabaseBase implements DatabaseType { $database = ( !$quoted || $this->isQuotedIdentifier( $database ) ? $database : $this->addIdentifierQuotes( $database ) ); $prefix = ''; } - $table = ( !$quoted || $this->isQuotedIdentifier( $table ) ? $table : $this->addIdentifierQuotes( "{$prefix}{$table}" ) ); + + $table = "{$prefix}{$table}"; + if ( $quoted && !$this->isQuotedIdentifier( $table ) ) { + $table = $this->addIdentifierQuotes( "{$table}" ); + } # Merge our database and table into our final table name. $tableName = ( isset( $database ) ? "{$database}.{$table}" : "{$table}" ); @@ -2316,6 +2320,8 @@ abstract class DatabaseBase implements DatabaseType { * Note that unlike most database abstraction functions, this function does not * automatically append database prefix, because it works at a lower * abstraction level. + * The table names passed to this function shall not be quoted (this + * function calls addIdentifierQuotes when needed). * * @param $oldName String: name of table whose structure should be copied * @param $newName String: name of table to be created -- 2.20.1