From: Sam Reed Date: Mon, 24 Jan 2011 15:30:35 +0000 (+0000) Subject: Fixup usage of raw sql in Title X-Git-Tag: 1.31.0-rc.0~32395 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=2e7a059abbb2b174a2c381744d23ed1c1fe3184c;p=lhc%2Fweb%2Fwiklou.git Fixup usage of raw sql in Title Followup r80856, add missing __METHOD__ --- 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__ + ); } /**