From e577cc985e2b5ff5b0732e3f8097a7479fdcd57c Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sat, 9 Feb 2013 15:03:23 +0100 Subject: [PATCH] Title.php: replace some '*' with explicit fields in selects It is good practice to select only fields which are used later Change-Id: Ie0075f2c2bbc4408f8d9b8967669d8c729b31914 --- includes/Title.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/includes/Title.php b/includes/Title.php index 6aa4cd2521..957af2bf1a 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -2343,9 +2343,12 @@ class Title { if ( !isset( $this->mTitleProtection ) ) { $dbr = wfGetDB( DB_SLAVE ); - $res = $dbr->select( 'protected_titles', '*', + $res = $dbr->select( + 'protected_titles', + array( 'pt_user', 'pt_reason', 'pt_expiry', 'pt_create_perm' ), array( 'pt_namespace' => $this->getNamespace(), 'pt_title' => $this->getDBkey() ), - __METHOD__ ); + __METHOD__ + ); // fetchRow returns false if there are no rows. $this->mTitleProtection = $dbr->fetchRow( $res ); @@ -2735,7 +2738,7 @@ class Title { $res = $dbr->select( 'page_restrictions', - '*', + array( 'pr_type', 'pr_expiry', 'pr_level', 'pr_cascade' ), array( 'pr_page' => $this->getArticleID() ), __METHOD__ ); @@ -4035,12 +4038,11 @@ class Title { $dbr = wfGetDB( DB_SLAVE ); - $res = $dbr->select( 'categorylinks', '*', - array( - 'cl_from' => $titleKey, - ), - __METHOD__, - array() + $res = $dbr->select( + 'categorylinks', + 'cl_to', + array( 'cl_from' => $titleKey ), + __METHOD__ ); if ( $res->numRows() > 0 ) { -- 2.20.1