r85905 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85904‎ | r85905 | r85906 >
Date:18:52, 12 April 2011
Author:platonides
Status:ok
Tags:
Comment:
Follow up r85888
Modified paths:
  • /trunk/phase3/includes/db/Database.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/Database.php
@@ -1566,7 +1566,11 @@
15671567 $database = ( !$quoted || $this->isQuotedIdentifier( $database ) ? $database : $this->addIdentifierQuotes( $database ) );
15681568 $prefix = '';
15691569 }
1570 - $table = ( !$quoted || $this->isQuotedIdentifier( $table ) ? $table : $this->addIdentifierQuotes( "{$prefix}{$table}" ) );
 1570+
 1571+ $table = "{$prefix}{$table}";
 1572+ if ( $quoted && !$this->isQuotedIdentifier( $table ) ) {
 1573+ $table = $this->addIdentifierQuotes( "{$table}" );
 1574+ }
15711575
15721576 # Merge our database and table into our final table name.
15731577 $tableName = ( isset( $database ) ? "{$database}.{$table}" : "{$table}" );
@@ -2316,6 +2320,8 @@
23172321 * Note that unlike most database abstraction functions, this function does not
23182322 * automatically append database prefix, because it works at a lower
23192323 * abstraction level.
 2324+ * The table names passed to this function shall not be quoted (this
 2325+ * function calls addIdentifierQuotes when needed).
23202326 *
23212327 * @param $oldName String: name of table whose structure should be copied
23222328 * @param $newName String: name of table to be created

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r85888Add parameter to tableName() to get the bare table name.platonides17:00, 12 April 2011

Status & tagging log