Merge "Revert "Adding sanity check to Title::isRedirect().""
[lhc/web/wiklou.git] / includes / api / ApiQueryWatchlistRaw.php
index 4adadf1..5e96dd5 100644 (file)
@@ -76,12 +76,12 @@ class ApiQueryWatchlistRaw extends ApiQueryGeneratorBase {
                                        "original value returned by the previous query", "_badcontinue" );
                        }
                        $ns = intval( $cont[0] );
-                       $title = $this->getDB()->strencode( $this->titleToKey( $cont[1] ) );
+                       $title = $this->getDB()->addQuotes( $this->titleToKey( $cont[1] ) );
                        $op = $params['dir'] == 'ascending' ? '>' : '<';
                        $this->addWhere(
-                               "wl_namespace $op '$ns' OR " .
-                               "(wl_namespace = '$ns' AND " .
-                               "wl_title $op= '$title')"
+                               "wl_namespace $op $ns OR " .
+                               "(wl_namespace = $ns AND " .
+                               "wl_title $op= $title)"
                        );
                }
 
@@ -90,7 +90,10 @@ class ApiQueryWatchlistRaw extends ApiQueryGeneratorBase {
                if ( count( $params['namespace'] ) == 1 ) {
                        $this->addOption( 'ORDER BY', 'wl_title' . $sort );
                } else {
-                       $this->addOption( 'ORDER BY', 'wl_namespace' . $sort . ', wl_title' . $sort );
+                       $this->addOption( 'ORDER BY', array(
+                               'wl_namespace' . $sort,
+                               'wl_title' . $sort
+                       ));
                }
                $this->addOption( 'LIMIT', $params['limit'] + 1 );
                $res = $this->select( __METHOD__ );