From 9457d80c3f3c01df9ed78c1450bb378618571870 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sun, 11 Dec 2011 18:39:31 +0000 Subject: [PATCH] * (bug 32415) Empty page get no size attribute in API output --- RELEASE-NOTES-1.19 | 1 + includes/api/ApiQueryRevisions.php | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 721603bedb..b786568715 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -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 === diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index 7cfe3f42bf..dcadc41f7f 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -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 ) { -- 2.20.1