r29561 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r29560‎ | r29561 | r29562 >
Date:22:15, 10 January 2008
Author:nikerabbit
Status:old
Tags:
Comment:
* No need to query database for special namespaces
Modified paths:
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Title.php
@@ -1258,6 +1258,11 @@
12591259 public function getTitleProtection() {
12601260 $dbr = wfGetDB( DB_SLAVE );
12611261
 1262+ // Can't protect pages in special namespaces
 1263+ if ( $this->getNamespace() < NS_MAIN ) {
 1264+ return false;
 1265+ }
 1266+
12621267 $res = $dbr->select( 'protected_titles', '*',
12631268 array ('pt_namespace' => $this->getNamespace(), 'pt_title' => $this->getDBKey()) );
12641269

Follow-up revisions

RevisionCommit summaryAuthorDate
r29571Tweak for r29561: don't grab a database object until we need itbrion04:41, 11 January 2008

Status & tagging log