From: Niklas Laxström Date: Thu, 10 Jan 2008 22:15:33 +0000 (+0000) Subject: * No need to query database for special namespaces X-Git-Tag: 1.31.0-rc.0~50068 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=6fd05d48cad0426c7b3ffe72866475c171e777e3;p=lhc%2Fweb%2Fwiklou.git * No need to query database for special namespaces --- diff --git a/includes/Title.php b/includes/Title.php index 4afa47f241..2976078e34 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1258,6 +1258,11 @@ class Title { public function getTitleProtection() { $dbr = wfGetDB( DB_SLAVE ); + // Can't protect pages in special namespaces + if ( $this->getNamespace() < NS_MAIN ) { + return false; + } + $res = $dbr->select( 'protected_titles', '*', array ('pt_namespace' => $this->getNamespace(), 'pt_title' => $this->getDBKey()) );