* No need to query database for special namespaces
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Thu, 10 Jan 2008 22:15:33 +0000 (22:15 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Thu, 10 Jan 2008 22:15:33 +0000 (22:15 +0000)
includes/Title.php

index 4afa47f..2976078 100644 (file)
@@ -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()) );