From: Brion Vibber Date: Fri, 11 Jan 2008 04:41:11 +0000 (+0000) Subject: Tweak for r29561: don't grab a database object until we need it X-Git-Tag: 1.31.0-rc.0~50064 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=839f3ffd651465380923a5110dc834c23fd9c27f;p=lhc%2Fweb%2Fwiklou.git Tweak for r29561: don't grab a database object until we need it --- diff --git a/includes/Title.php b/includes/Title.php index 2976078e34..e0d55143e1 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1256,13 +1256,12 @@ class Title { * protection, or false if there's none. */ public function getTitleProtection() { - $dbr = wfGetDB( DB_SLAVE ); - // Can't protect pages in special namespaces if ( $this->getNamespace() < NS_MAIN ) { return false; } + $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( 'protected_titles', '*', array ('pt_namespace' => $this->getNamespace(), 'pt_title' => $this->getDBKey()) );