r10908 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r10907‎ | r10908 | r10909 >
Date:07:35, 5 September 2005
Author:vibber
Status:old
Tags:
Comment:
* Use strval() to make sure we don't accidentally get null on bad revision
text loads or other fields mucking up XML export output
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SpecialExport.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialExport.php
@@ -339,10 +339,10 @@
340340 print "<page>\n";
341341 $title = Title::makeTitle( $row->page_namespace, $row->page_title );
342342 print ' ' . wfElementClean( 'title', array(), $title->getPrefixedText() ) . "\n";
343 - print ' ' . wfElement( 'id', array(), $row->page_id ) . "\n";
 343+ print ' ' . wfElement( 'id', array(), strval( $row->page_id ) ) . "\n";
344344 if( '' != $row->page_restrictions ) {
345345 print ' ' . wfElement( 'restrictions', array(),
346 - $row->page_restrictions ) . "\n";
 346+ strval( $row->page_restrictions ) ) . "\n";
347347 }
348348 }
349349
@@ -373,17 +373,17 @@
374374 wfProfileIn( $fname );
375375
376376 print " <revision>\n";
377 - print " " . wfElement( 'id', null, $row->rev_id ) . "\n";
 377+ print " " . wfElement( 'id', null, strval( $row->rev_id ) ) . "\n";
378378
379 - $ts = wfTimestamp2ISO8601( $row->rev_timestamp );
 379+ $ts = wfTimestamp2ISO8601( strval( $row->rev_timestamp ) );
380380 print " " . wfElement( 'timestamp', null, $ts ) . "\n";
381381
382382 print " <contributor>\n";
383383 if( $row->rev_user ) {
384 - print " " . wfElementClean( 'username', null, $row->rev_user_text ) . "\n";
385 - print " " . wfElement( 'id', null, $row->rev_user ) . "\n";
 384+ print " " . wfElementClean( 'username', null, strval( $row->rev_user_text ) ) . "\n";
 385+ print " " . wfElement( 'id', null, strval( $row->rev_user ) ) . "\n";
386386 } else {
387 - print " " . wfElementClean( 'ip', null, $row->rev_user_text ) . "\n";
 387+ print " " . wfElementClean( 'ip', null, strval( $row->rev_user_text ) ) . "\n";
388388 }
389389 print " </contributor>\n";
390390
@@ -391,10 +391,10 @@
392392 print " <minor/>\n";
393393 }
394394 if( $row->rev_comment != '' ) {
395 - print " " . wfElementClean( 'comment', null, $row->rev_comment ) . "\n";
 395+ print " " . wfElementClean( 'comment', null, strval( $row->rev_comment ) ) . "\n";
396396 }
397397
398 - $text = Revision::getRevisionText( $row );
 398+ $text = strval( Revision::getRevisionText( $row ) );
399399 print " " . wfElementClean( 'text', array( 'xml:space' => 'preserve' ), $text ) . "\n";
400400
401401 print " </revision>\n";
Index: trunk/phase3/RELEASE-NOTES
@@ -84,6 +84,8 @@
8585 * (bug 2143) Update Vietnamese interface
8686 * Add 'reupload' and 'reupload-shared' permission keys to restrict new uploads
8787 overwriting existing files; default is the old behavior (allowed).
 88+* Use strval() to make sure we don't accidentally get null on bad revision
 89+ text loads or other fields mucking up XML export output
8890
8991
9092 === Caveats ===

Status & tagging log