From 6d5208cef507692411bdadf9f57c9bc7ede465b6 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Fri, 18 Jan 2013 16:15:41 +0100 Subject: [PATCH] Use array for database fields Also reuse a existing database object Change-Id: I42cc0636b25ba6266ab37ce0a7422e5863edf741 --- includes/specials/SpecialProtectedpages.php | 6 +++--- includes/specials/SpecialProtectedtitles.php | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/includes/specials/SpecialProtectedpages.php b/includes/specials/SpecialProtectedpages.php index 74ed5378e4..6a1a9f02c1 100644 --- a/includes/specials/SpecialProtectedpages.php +++ b/includes/specials/SpecialProtectedpages.php @@ -343,8 +343,7 @@ class ProtectedPagesPager extends AlphabeticPager { } if( $this->indefonly ) { - $db = wfGetDB( DB_SLAVE ); - $conds[] = "pr_expiry = {$db->addQuotes( $db->getInfinity() )} OR pr_expiry IS NULL"; + $conds[] = "pr_expiry = {$this->mDb->addQuotes( $this->mDb->getInfinity() )} OR pr_expiry IS NULL"; } if( $this->cascadeonly ) { $conds[] = "pr_cascade = '1'"; @@ -356,7 +355,8 @@ class ProtectedPagesPager extends AlphabeticPager { $conds[] = 'page_namespace=' . $this->mDb->addQuotes( $this->namespace ); return array( 'tables' => array( 'page_restrictions', 'page' ), - 'fields' => 'pr_id,page_namespace,page_title,page_len,pr_type,pr_level,pr_expiry,pr_cascade', + 'fields' => array( 'pr_id', 'page_namespace', 'page_title', 'page_len', + 'pr_type', 'pr_level', 'pr_expiry', 'pr_cascade' ), 'conds' => $conds ); } diff --git a/includes/specials/SpecialProtectedtitles.php b/includes/specials/SpecialProtectedtitles.php index a80f0d0a1c..cf1e2b4017 100644 --- a/includes/specials/SpecialProtectedtitles.php +++ b/includes/specials/SpecialProtectedtitles.php @@ -238,7 +238,8 @@ class ProtectedTitlesPager extends AlphabeticPager { $conds[] = 'pt_namespace=' . $this->mDb->addQuotes( $this->namespace ); return array( 'tables' => 'protected_titles', - 'fields' => 'pt_namespace,pt_title,pt_create_perm,pt_expiry,pt_timestamp', + 'fields' => array( 'pt_namespace', 'pt_title', 'pt_create_perm', + 'pt_expiry', 'pt_timestamp' ), 'conds' => $conds ); } -- 2.20.1