Merge "Api method documentation tweaks"
[lhc/web/wiklou.git] / includes / api / ApiQueryWatchlistRaw.php
index ce4ce50..38b17fc 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( $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)"
                        );
                }
 
@@ -103,8 +103,7 @@ class ApiQueryWatchlistRaw extends ApiQueryGeneratorBase {
                foreach ( $res as $row ) {
                        if ( ++$count > $params['limit'] ) {
                                // We've reached the one extra which shows that there are additional pages to be had. Stop here...
-                               $this->setContinueEnumParameter( 'continue', $row->wl_namespace . '|' .
-                                                                       $this->keyToTitle( $row->wl_title ) );
+                               $this->setContinueEnumParameter( 'continue', $row->wl_namespace . '|' . $row->wl_title );
                                break;
                        }
                        $t = Title::makeTitle( $row->wl_namespace, $row->wl_title );
@@ -118,8 +117,7 @@ class ApiQueryWatchlistRaw extends ApiQueryGeneratorBase {
                                }
                                $fit = $this->getResult()->addValue( $this->getModuleName(), null, $vals );
                                if ( !$fit ) {
-                                       $this->setContinueEnumParameter( 'continue', $row->wl_namespace . '|' .
-                                                                       $this->keyToTitle( $row->wl_title ) );
+                                       $this->setContinueEnumParameter( 'continue', $row->wl_namespace . '|' . $row->wl_title );
                                        break;
                                }
                        } else {
@@ -192,6 +190,21 @@ class ApiQueryWatchlistRaw extends ApiQueryGeneratorBase {
                );
        }
 
+       public function getResultProperties() {
+               return array(
+                       '' => array(
+                               'ns' => 'namespace',
+                               'title' => 'string'
+                       ),
+                       'changed' => array(
+                               'changed' => array(
+                                       ApiBase::PROP_TYPE => 'timestamp',
+                                       ApiBase::PROP_NULLABLE => true
+                               )
+                       )
+               );
+       }
+
        public function getDescription() {
                return "Get all pages on the logged in user's watchlist";
        }