merging latest master
[lhc/web/wiklou.git] / includes / api / ApiQueryRevisions.php
index 0bb0d77..2c0bf1f 100644 (file)
@@ -253,6 +253,16 @@ class ApiQueryRevisions extends ApiQueryBase {
                                $this->dieUsage( 'user and excludeuser cannot be used together', 'badparams' );
                        }
 
+                       // Continuing effectively uses startid. But we can't use rvstartid
+                       // directly, because there is no way to tell the client to ''not''
+                       // send rvstart if it sent it in the original query. So instead we
+                       // send the continuation startid as rvcontinue, and ignore both
+                       // rvstart and rvstartid when that is supplied.
+                       if ( !is_null( $params['continue'] ) ) {
+                               $params['startid'] = $params['continue'];
+                               unset( $params['start'] );
+                       }
+
                        // This code makes an assumption that sorting by rev_id and rev_timestamp produces
                        // the same result. This way users may request revisions starting at a given time,
                        // but to page through results use the rev_id returned after each page.
@@ -362,14 +372,14 @@ class ApiQueryRevisions extends ApiQueryBase {
                                if ( !$enumRevMode ) {
                                        ApiBase::dieDebug( __METHOD__, 'Got more rows then expected' ); // bug report
                                }
-                               $this->setContinueEnumParameter( 'startid', intval( $row->rev_id ) );
+                               $this->setContinueEnumParameter( 'continue', intval( $row->rev_id ) );
                                break;
                        }
 
                        $fit = $this->addPageSubItem( $row->rev_page, $this->extractRowInfo( $row ), 'rev' );
                        if ( !$fit ) {
                                if ( $enumRevMode ) {
-                                       $this->setContinueEnumParameter( 'startid', intval( $row->rev_id ) );
+                                       $this->setContinueEnumParameter( 'continue', intval( $row->rev_id ) );
                                } elseif ( $revCount > 0 ) {
                                        $this->setContinueEnumParameter( 'continue', intval( $row->rev_id ) );
                                } else {