From c8102513e52ac2cc198879098d717abfee3d14bd Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sun, 11 Dec 2011 19:01:11 +0000 Subject: [PATCH] * (bug 32414) Empty page get a empty bytes attribute in Export/Dump Pushing the values through intval seems enough, null -> 0 reedy@fenari:/home/wikipedia/common$ mwscript eval.php dewiki > $var = null; > var_dump( intval( $var ) ); int(0) > var_dump($var ); NULL --- RELEASE-NOTES-1.19 | 3 ++- includes/Export.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index b786568715..4d442a9089 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -178,7 +178,7 @@ production. also happens to create the page * (bug 32960) Remove EmailAuthenticationTimestamp from database when a email address is removed -* (bug 31759) Undefined property notice in querypages API +* (bug 32414) Empty page get a empty bytes attribute in Export/Dump === API changes in 1.19 === * (bug 19838) siprop=interwikimap can now use the interwiki cache. @@ -204,6 +204,7 @@ production. * (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 +* (bug 31759) Undefined property notice in querypages API === Languages updated in 1.19 === diff --git a/includes/Export.php b/includes/Export.php index a7fabe2024..0dc0ad9b97 100644 --- a/includes/Export.php +++ b/includes/Export.php @@ -543,12 +543,12 @@ class XmlDumpWriter { // Raw text from the database may have invalid chars $text = strval( Revision::getRevisionText( $row ) ); $out .= " " . Xml::elementClean( 'text', - array( 'xml:space' => 'preserve', 'bytes' => $row->rev_len ), + array( 'xml:space' => 'preserve', 'bytes' => intval( $row->rev_len ) ), strval( $text ) ) . "\n"; } else { // Stub output $out .= " " . Xml::element( 'text', - array( 'id' => $row->rev_text_id, 'bytes' => $row->rev_len ), + array( 'id' => $row->rev_text_id, 'bytes' => intval( $row->rev_len ) ), "" ) . "\n"; } -- 2.20.1