From c3458a3199e600b41c12c569e600090a9c2b1912 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 5 Sep 2005 07:35:29 +0000 Subject: [PATCH] * Use strval() to make sure we don't accidentally get null on bad revision text loads or other fields mucking up XML export output --- RELEASE-NOTES | 2 ++ includes/SpecialExport.php | 18 +++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 49441727d1..5fe5bce2f5 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -84,6 +84,8 @@ fully support the editing toolbar, but was found to be too confusing. * (bug 2143) Update Vietnamese interface * Add 'reupload' and 'reupload-shared' permission keys to restrict new uploads overwriting existing files; default is the old behavior (allowed). +* Use strval() to make sure we don't accidentally get null on bad revision + text loads or other fields mucking up XML export output === Caveats === diff --git a/includes/SpecialExport.php b/includes/SpecialExport.php index d15971beff..8de0f184fc 100644 --- a/includes/SpecialExport.php +++ b/includes/SpecialExport.php @@ -339,10 +339,10 @@ class WikiExporter { print "\n"; $title = Title::makeTitle( $row->page_namespace, $row->page_title ); print ' ' . wfElementClean( 'title', array(), $title->getPrefixedText() ) . "\n"; - print ' ' . wfElement( 'id', array(), $row->page_id ) . "\n"; + print ' ' . wfElement( 'id', array(), strval( $row->page_id ) ) . "\n"; if( '' != $row->page_restrictions ) { print ' ' . wfElement( 'restrictions', array(), - $row->page_restrictions ) . "\n"; + strval( $row->page_restrictions ) ) . "\n"; } } @@ -373,17 +373,17 @@ class WikiExporter { wfProfileIn( $fname ); print " \n"; - print " " . wfElement( 'id', null, $row->rev_id ) . "\n"; + print " " . wfElement( 'id', null, strval( $row->rev_id ) ) . "\n"; - $ts = wfTimestamp2ISO8601( $row->rev_timestamp ); + $ts = wfTimestamp2ISO8601( strval( $row->rev_timestamp ) ); print " " . wfElement( 'timestamp', null, $ts ) . "\n"; print " \n"; if( $row->rev_user ) { - print " " . wfElementClean( 'username', null, $row->rev_user_text ) . "\n"; - print " " . wfElement( 'id', null, $row->rev_user ) . "\n"; + print " " . wfElementClean( 'username', null, strval( $row->rev_user_text ) ) . "\n"; + print " " . wfElement( 'id', null, strval( $row->rev_user ) ) . "\n"; } else { - print " " . wfElementClean( 'ip', null, $row->rev_user_text ) . "\n"; + print " " . wfElementClean( 'ip', null, strval( $row->rev_user_text ) ) . "\n"; } print " \n"; @@ -391,10 +391,10 @@ class WikiExporter { print " \n"; } if( $row->rev_comment != '' ) { - print " " . wfElementClean( 'comment', null, $row->rev_comment ) . "\n"; + print " " . wfElementClean( 'comment', null, strval( $row->rev_comment ) ) . "\n"; } - $text = Revision::getRevisionText( $row ); + $text = strval( Revision::getRevisionText( $row ) ); print " " . wfElementClean( 'text', array( 'xml:space' => 'preserve' ), $text ) . "\n"; print " \n"; -- 2.20.1