X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fexport%2FXmlDumpWriter.php;h=990f16dca060ce9c88b49f6a082dbacefc7839bc;hb=d19826aa35b206847a568a4b2c1c9ffaa615fca5;hp=52bf0f091090f636c926fe90d28d598b624e6d5c;hpb=56ff636b66268729d31e9bca89c7799a86e17a9b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/export/XmlDumpWriter.php b/includes/export/XmlDumpWriter.php index 52bf0f0910..990f16dca0 100644 --- a/includes/export/XmlDumpWriter.php +++ b/includes/export/XmlDumpWriter.php @@ -199,7 +199,6 @@ class XmlDumpWriter { * @access private */ function writeRevision( $row ) { - $out = " \n"; $out .= " " . Xml::element( 'id', null, strval( $row->rev_id ) ) . "\n"; if ( isset( $row->rev_parent_id ) && $row->rev_parent_id ) { @@ -219,8 +218,11 @@ class XmlDumpWriter { } if ( isset( $row->rev_deleted ) && ( $row->rev_deleted & Revision::DELETED_COMMENT ) ) { $out .= " " . Xml::element( 'comment', [ 'deleted' => 'deleted' ] ) . "\n"; - } elseif ( $row->rev_comment != '' ) { - $out .= " " . Xml::elementClean( 'comment', [], strval( $row->rev_comment ) ) . "\n"; + } else { + $comment = CommentStore::newKey( 'rev_comment' )->getComment( $row )->text; + if ( $comment != '' ) { + $out .= " " . Xml::elementClean( 'comment', [], strval( $comment ) ) . "\n"; + } } if ( isset( $row->rev_content_model ) && !is_null( $row->rev_content_model ) ) { @@ -287,7 +289,6 @@ class XmlDumpWriter { * @access private */ function writeLogItem( $row ) { - $out = " \n"; $out .= " " . Xml::element( 'id', null, strval( $row->log_id ) ) . "\n"; @@ -301,8 +302,11 @@ class XmlDumpWriter { if ( $row->log_deleted & LogPage::DELETED_COMMENT ) { $out .= " " . Xml::element( 'comment', [ 'deleted' => 'deleted' ] ) . "\n"; - } elseif ( $row->log_comment != '' ) { - $out .= " " . Xml::elementClean( 'comment', null, strval( $row->log_comment ) ) . "\n"; + } else { + $comment = CommentStore::newKey( 'log_comment' )->getComment( $row )->text; + if ( $comment != '' ) { + $out .= " " . Xml::elementClean( 'comment', null, strval( $comment ) ) . "\n"; + } } $out .= " " . Xml::element( 'type', null, strval( $row->log_type ) ) . "\n"; @@ -433,6 +437,9 @@ class XmlDumpWriter { global $wgContLang; $prefix = $wgContLang->getFormattedNsText( $title->getNamespace() ); + // @todo Emit some kind of warning to the user if $title->getNamespace() !== + // NS_MAIN and $prefix === '' (viz. pages in an unregistered namespace) + if ( $prefix !== '' ) { $prefix .= ':'; }