r85886 broke $wgSharedPrefix
authorPlatonides <platonides@users.mediawiki.org>
Mon, 25 Jul 2011 20:08:49 +0000 (20:08 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Mon, 25 Jul 2011 20:08:49 +0000 (20:08 +0000)
includes/db/Database.php

index a3a439c..dabe3ac 100644 (file)
@@ -1883,6 +1883,12 @@ abstract class DatabaseBase implements DatabaseType {
                }
                $prefix = $this->mTablePrefix; # Default prefix
 
+               # A database name has been specified in input. We don't want any 
+               # prefixes added.
+               if ( isset( $database ) ) {
+                       $prefix = '';
+               }
+
                # 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.
@@ -1898,7 +1904,6 @@ abstract class DatabaseBase implements DatabaseType {
                # Quote the $database and $table and apply the prefix if not quoted.
                if ( isset( $database ) ) {
                        $database = ( !$quoted || $this->isQuotedIdentifier( $database ) ? $database : $this->addIdentifierQuotes( $database ) );
-                       $prefix = '';
                }
 
                $table = "{$prefix}{$table}";