r105816 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105815‎ | r105816 | r105817 >
Date:19:01, 11 December 2011
Author:reedy
Status:ok
Tags:
Comment:
* (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
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/Export.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -178,7 +178,7 @@
179179 also happens to create the page
180180 * (bug 32960) Remove EmailAuthenticationTimestamp from database when a
181181 email address is removed
182 -* (bug 31759) Undefined property notice in querypages API
 182+* (bug 32414) Empty page get a empty bytes attribute in Export/Dump
183183
184184 === API changes in 1.19 ===
185185 * (bug 19838) siprop=interwikimap can now use the interwiki cache.
@@ -204,6 +204,7 @@
205205 * (bug 32688) Paraminfo for parameter "generator" of the query module shows too
206206 many types
207207 * (bug 32415) Empty page get no size attribute in API output
 208+* (bug 31759) Undefined property notice in querypages API
208209
209210 === Languages updated in 1.19 ===
210211
Index: trunk/phase3/includes/Export.php
@@ -543,12 +543,12 @@
544544 // Raw text from the database may have invalid chars
545545 $text = strval( Revision::getRevisionText( $row ) );
546546 $out .= " " . Xml::elementClean( 'text',
547 - array( 'xml:space' => 'preserve', 'bytes' => $row->rev_len ),
 547+ array( 'xml:space' => 'preserve', 'bytes' => intval( $row->rev_len ) ),
548548 strval( $text ) ) . "\n";
549549 } else {
550550 // Stub output
551551 $out .= " " . Xml::element( 'text',
552 - array( 'id' => $row->rev_text_id, 'bytes' => $row->rev_len ),
 552+ array( 'id' => $row->rev_text_id, 'bytes' => intval( $row->rev_len ) ),
553553 "" ) . "\n";
554554 }
555555

Status & tagging log