From: umherirrender Date: Fri, 18 Jan 2013 15:15:41 +0000 (+0100) Subject: Use array for database fields X-Git-Tag: 1.31.0-rc.0~20994 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=6d5208cef507692411bdadf9f57c9bc7ede465b6;p=lhc%2Fweb%2Fwiklou.git Use array for database fields Also reuse a existing database object Change-Id: I42cc0636b25ba6266ab37ce0a7422e5863edf741 --- 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 ); }