Merge "(bug 33222) Add parentid to revision in export xml"
[lhc/web/wiklou.git] / includes / api / ApiQueryRevisions.php
index 426de6c..1a5ad17 100644 (file)
@@ -297,7 +297,7 @@ class ApiQueryRevisions extends ApiQueryBase {
                        $this->addWhereFld( 'rev_id', array_keys( $revs ) );
 
                        if ( !is_null( $params['continue'] ) ) {
-                               $this->addWhere( "rev_id >= '" . intval( $params['continue'] ) . "'" );
+                               $this->addWhere( 'rev_id >= ' . intval( $params['continue'] ) );
                        }
                        $this->addOption( 'ORDER BY', 'rev_id' );
 
@@ -329,9 +329,9 @@ class ApiQueryRevisions extends ApiQueryBase {
                                $pageid = intval( $cont[0] );
                                $revid = intval( $cont[1] );
                                $this->addWhere(
-                                       "rev_page > '$pageid' OR " .
-                                       "(rev_page = '$pageid' AND " .
-                                       "rev_id >= '$revid')"
+                                       "rev_page > $pageid OR " .
+                                       "(rev_page = $pageid AND " .
+                                       "rev_id >= $revid)"
                                );
                        }
                        $this->addOption( 'ORDER BY', array(
@@ -648,6 +648,66 @@ class ApiQueryRevisions extends ApiQueryBase {
                );
        }
 
+       public function getResultProperties() {
+               $props = array(
+                       '' => array(),
+                       'ids' => array(
+                               'revid' => 'integer',
+                               'parentid' => array(
+                                       ApiBase::PROP_TYPE => 'integer',
+                                       ApiBase::PROP_NULLABLE => true
+                               )
+                       ),
+                       'flags' => array(
+                               'minor' => 'boolean'
+                       ),
+                       'user' => array(
+                               'userhidden' => 'boolean',
+                               'user' => 'string',
+                               'anon' => 'boolean'
+                       ),
+                       'userid' => array(
+                               'userhidden' => 'boolean',
+                               'userid' => 'integer',
+                               'anon' => 'boolean'
+                       ),
+                       'timestamp' => array(
+                               'timestamp' => 'timestamp'
+                       ),
+                       'size' => array(
+                               'size' => 'integer'
+                       ),
+                       'sha1' => array(
+                               'sha1' => 'string'
+                       ),
+                       'comment' => array(
+                               'commenthidden' => 'boolean',
+                               'comment' => array(
+                                       ApiBase::PROP_TYPE => 'string',
+                                       ApiBase::PROP_NULLABLE => true
+                               )
+                       ),
+                       'parsedcomment' => array(
+                               'commenthidden' => 'boolean',
+                               'parsedcomment' => array(
+                                       ApiBase::PROP_TYPE => 'string',
+                                       ApiBase::PROP_NULLABLE => true
+                               )
+                       ),
+                       'content' => array(
+                               '*' => array(
+                                       ApiBase::PROP_TYPE => 'string',
+                                       ApiBase::PROP_NULLABLE => true
+                               ),
+                               'texthidden' => 'boolean'
+                       )
+               );
+
+               self::addTokenProperties( $props, $this->getTokenFunctions() );
+
+               return $props;
+       }
+
        public function getDescription() {
                return array(
                        'Get revision information',