* (bug 32415) Empty page get no size attribute in API output
authorSam Reed <reedy@users.mediawiki.org>
Sun, 11 Dec 2011 18:39:31 +0000 (18:39 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sun, 11 Dec 2011 18:39:31 +0000 (18:39 +0000)
RELEASE-NOTES-1.19
includes/api/ApiQueryRevisions.php

index 721603b..b786568 100644 (file)
@@ -203,6 +203,7 @@ production.
 * Added 'APIGetDescription' hook.
 * (bug 32688) Paraminfo for parameter "generator" of the query module shows too
   many types
+* (bug 32415) Empty page get no size attribute in API output
 
 === Languages updated in 1.19 ===
 
index 7cfe3f4..dcadc41 100644 (file)
@@ -404,8 +404,12 @@ class ApiQueryRevisions extends ApiQueryBase {
                        $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $revision->getTimestamp() );
                }
 
-               if ( $this->fld_size && !is_null( $revision->getSize() ) ) {
-                       $vals['size'] = intval( $revision->getSize() );
+               if ( $this->fld_size ) {
+                       if ( !is_null( $revision->getSize() ) ) {
+                               $vals['size'] = intval( $revision->getSize() );
+                       } else {
+                               $vals['size'] = 0;
+                       }
                }
 
                if ( $this->fld_comment || $this->fld_parsedcomment ) {