* (bug 32414) Empty page get a empty bytes attribute in Export/Dump
authorSam Reed <reedy@users.mediawiki.org>
Sun, 11 Dec 2011 19:01:11 +0000 (19:01 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sun, 11 Dec 2011 19:01:11 +0000 (19:01 +0000)
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
includes/Export.php

index b786568..4d442a9 100644 (file)
@@ -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 ===
 
index a7fabe2..0dc0ad9 100644 (file)
@@ -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";
                }