Merge "(bug 43207) Fix regression in API generator=duplicatefiles"
[lhc/web/wiklou.git] / includes / api / ApiQueryRevisions.php
index 4f08605..1d46b7a 100644 (file)
@@ -439,12 +439,14 @@ class ApiQueryRevisions extends ApiQueryBase {
                        }
                }
 
-               if ( $this->fld_sha1 ) {
+               if ( $this->fld_sha1 && !$revision->isDeleted( Revision::DELETED_TEXT ) ) {
                        if ( $revision->getSha1() != '' ) {
                                $vals['sha1'] = wfBaseConvert( $revision->getSha1(), 36, 16, 40 );
                        } else {
                                $vals['sha1'] = '';
                        }
+               } elseif ( $this->fld_sha1 ) {
+                       $vals['sha1hidden'] = '';
                }
 
                if ( $this->fld_contentmodel ) {
@@ -787,7 +789,10 @@ class ApiQueryRevisions extends ApiQueryBase {
                                        ApiBase::PROP_NULLABLE => true
                                ),
                                'texthidden' => 'boolean'
-                       )
+                       ),
+                       'contentmodel' => array(
+                               'contentmodel' => 'string'
+                       ),
                );
 
                self::addTokenProperties( $props, $this->getTokenFunctions() );