From 6fd05d48cad0426c7b3ffe72866475c171e777e3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Thu, 10 Jan 2008 22:15:33 +0000 Subject: [PATCH] * No need to query database for special namespaces --- includes/Title.php | 5 +++++ 1 file changed, 5 insertions(+) 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()) ); -- 2.20.1