From ecd99cb8a3915be38da5d4e25e912112058ffd81 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Tue, 6 Sep 2011 20:44:03 +0000 Subject: [PATCH] Fixme on r85888: boolean params are evil, use a nice simple string instead :) --- includes/db/Database.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/includes/db/Database.php b/includes/db/Database.php index ec10f0c450..0c9bb8cc37 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -1925,11 +1925,13 @@ abstract class DatabaseBase implements DatabaseType { * when calling query() directly. * * @param $name String: database table name - * @param $quoted Boolean: Automatically pass the table name through - * addIdentifierQuotes() so that it can be used in a query. + * @param $format String One of: + * quoted - Automatically pass the table name through addIdentifierQuotes() + * so that it can be used in a query. + * raw - Do not add identifier quotes to the table name * @return String: full database name */ - function tableName( $name, $quoted = true ) { + function tableName( $name, $format = 'quoted' ) { global $wgSharedDB, $wgSharedPrefix, $wgSharedTables; # Skip the entire process when we have a string quoted on both ends. # Note that we check the end so that we will still quote any use of @@ -1981,11 +1983,11 @@ 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 ) ); + $database = ( $format == 'quoted' || $this->isQuotedIdentifier( $database ) ? $database : $this->addIdentifierQuotes( $database ) ); } $table = "{$prefix}{$table}"; - if ( $quoted && !$this->isQuotedIdentifier( $table ) ) { + if ( $format == 'quoted' && !$this->isQuotedIdentifier( $table ) ) { $table = $this->addIdentifierQuotes( "{$table}" ); } -- 2.20.1