From 2e7a059abbb2b174a2c381744d23ed1c1fe3184c Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Mon, 24 Jan 2011 15:30:35 +0000 Subject: [PATCH] Fixup usage of raw sql in Title Followup r80856, add missing __METHOD__ --- includes/Title.php | 16 ++++++++-------- includes/search/SearchMySQL.php | 4 +++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/includes/Title.php b/includes/Title.php index d215fbcc5d..3934272452 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -3519,15 +3519,15 @@ class Title { $titlekey = $this->getArticleId(); $dbr = wfGetDB( DB_SLAVE ); - $categorylinks = $dbr->tableName( 'categorylinks' ); - # NEW SQL - $sql = "SELECT * FROM $categorylinks" - . " WHERE cl_from='$titlekey'" - . " AND cl_from <> '0'" - . " ORDER BY cl_sortkey"; - - $res = $dbr->query( $sql ); + $res = $dbr->select( 'categorylinks', '*', + array( + 'cl_from' => $titleKey, + "cl_from <> '0'", + ), + __METHOD__, + array( 'ORDER BY' => 'cl_sortkey' ) + ); $data = array(); if ( $dbr->numRows( $res ) > 0 ) { diff --git a/includes/search/SearchMySQL.php b/includes/search/SearchMySQL.php index b75f116dd2..447b35b8e9 100644 --- a/includes/search/SearchMySQL.php +++ b/includes/search/SearchMySQL.php @@ -284,7 +284,9 @@ class SearchMySQL extends SearchEngine { $match, $this->queryRedirect(), $this->queryNamespaces() - ) ); + ), + __METHOD__ + ); } /** -- 2.20.1