r85886 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85885‎ | r85886 | r85887 >
Date:16:57, 12 April 2011
Author:platonides
Status:resolved (Comments)
Tags:
Comment:
No need to quote just to avoid the prefixes.
Modified paths:
  • /trunk/phase3/includes/db/Database.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/Database.php
@@ -1547,12 +1547,6 @@
15481548 }
15491549 $prefix = $this->mTablePrefix; # Default prefix
15501550
1551 - # A database name has been specified in input. Quote the table name
1552 - # because we don't want any prefixes added.
1553 - if ( isset( $database ) ) {
1554 - $table = ( $this->isQuotedIdentifier( $table ) ? $table : $this->addIdentifierQuotes( $table ) );
1555 - }
1556 -
15571551 # Note that we use the long format because php will complain in in_array if
15581552 # the input is not an array, and will complain in is_array if it is not set.
15591553 if ( !isset( $database ) # Don't use shared database if pre selected.
@@ -1568,6 +1562,7 @@
15691563 # Quote the $database and $table and apply the prefix if not quoted.
15701564 if ( isset( $database ) ) {
15711565 $database = ( $this->isQuotedIdentifier( $database ) ? $database : $this->addIdentifierQuotes( $database ) );
 1566+ $prefix = '';
15721567 }
15731568 $table = ( $this->isQuotedIdentifier( $table ) ? $table : $this->addIdentifierQuotes( "{$prefix}{$table}" ) );
15741569

Follow-up revisions

RevisionCommit summaryAuthorDate
r93103r85886 broke $wgSharedPrefixplatonides20:08, 25 July 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r85884Abstract tableName() by adding new function isQuotedIdentifier() to databases....platonides16:34, 12 April 2011

Comments

#Comment by 😂 (talk | contribs)   20:20, 25 July 2011

Curious...how did you manage to mark you own revision "resolved?" It shouldn't allow that ;-)

#Comment by Reedy (talk | contribs)   20:22, 25 July 2011

AFAIK we only stopped people ok'ing their own, not RESOLVED'ing them..

#Comment by Aaron Schulz (talk | contribs)   20:23, 25 July 2011

I thought neither were allowed.

#Comment by Platonides (talk | contribs)   20:50, 25 July 2011

The usual way. Perhaps CodeReview noticed that I lowered the status from ok ;)

Status & tagging log