No need to quote just to avoid the prefixes.
authorPlatonides <platonides@users.mediawiki.org>
Tue, 12 Apr 2011 16:57:44 +0000 (16:57 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Tue, 12 Apr 2011 16:57:44 +0000 (16:57 +0000)
includes/db/Database.php

index 3a5da57..19a125c 100644 (file)
@@ -1547,12 +1547,6 @@ abstract class DatabaseBase implements DatabaseType {
                }
                $prefix = $this->mTablePrefix; # Default prefix
 
-               # A database name has been specified in input. Quote the table name
-               # because we don't want any prefixes added.
-               if ( isset( $database ) ) {
-                       $table = ( $this->isQuotedIdentifier( $table ) ? $table : $this->addIdentifierQuotes( $table ) );
-               }
-
                # Note that we use the long format because php will complain in in_array if
                # the input is not an array, and will complain in is_array if it is not set.
                if ( !isset( $database ) # Don't use shared database if pre selected.
@@ -1568,6 +1562,7 @@ abstract class DatabaseBase implements DatabaseType {
                # Quote the $database and $table and apply the prefix if not quoted.
                if ( isset( $database ) ) {
                        $database = ( $this->isQuotedIdentifier( $database ) ? $database : $this->addIdentifierQuotes( $database ) );
+                       $prefix = '';
                }
                $table = ( $this->isQuotedIdentifier( $table ) ? $table : $this->addIdentifierQuotes( "{$prefix}{$table}" ) );