r29571 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r29570‎ | r29571 | r29572 >
Date:04:41, 11 January 2008
Author:brion
Status:old
Tags:
Comment:
Tweak for r29561: don't grab a database object until we need it
Modified paths:
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Title.php
@@ -1256,13 +1256,12 @@
12571257 * protection, or false if there's none.
12581258 */
12591259 public function getTitleProtection() {
1260 - $dbr = wfGetDB( DB_SLAVE );
1261 -
12621260 // Can't protect pages in special namespaces
12631261 if ( $this->getNamespace() < NS_MAIN ) {
12641262 return false;
12651263 }
12661264
 1265+ $dbr = wfGetDB( DB_SLAVE );
12671266 $res = $dbr->select( 'protected_titles', '*',
12681267 array ('pt_namespace' => $this->getNamespace(), 'pt_title' => $this->getDBKey()) );
12691268

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r29561* No need to query database for special namespacesnikerabbit22:15, 10 January 2008

Status & tagging log