Fixup usage of raw sql in Title
authorSam Reed <reedy@users.mediawiki.org>
Mon, 24 Jan 2011 15:30:35 +0000 (15:30 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Mon, 24 Jan 2011 15:30:35 +0000 (15:30 +0000)
Followup r80856, add missing __METHOD__

includes/Title.php
includes/search/SearchMySQL.php

index d215fbc..3934272 100644 (file)
@@ -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 ) {
index b75f116..447b35b 100644 (file)
@@ -284,7 +284,9 @@ class SearchMySQL extends SearchEngine {
                                $match,
                                $this->queryRedirect(),
                                $this->queryNamespaces()
-                       ) );
+                       ),
+                       __METHOD__
+               );
        }
 
        /**