From: Chad Horohoe Date: Tue, 6 Sep 2011 20:44:03 +0000 (+0000) Subject: Fixme on r85888: boolean params are evil, use a nice simple string instead :) X-Git-Tag: 1.31.0-rc.0~27863 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=ecd99cb8a3915be38da5d4e25e912112058ffd81;p=lhc%2Fweb%2Fwiklou.git Fixme on r85888: boolean params are evil, use a nice simple string instead :) --- 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}" ); }