X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Fexport%2FXmlDumpWriter.php;h=943408cc98c8a4e2254997e3bf0af0735c12f515;hb=b5cddfb27b0d50bd396b1ff92d022b2dec766754;hp=5be166b29d47c6920aaadc5f9715ed37d847c243;hpb=f9e21f91e459c40fed6d8f2e76cccbce07e2ba1b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/export/XmlDumpWriter.php b/includes/export/XmlDumpWriter.php index 5be166b29d..943408cc98 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 ) { @@ -269,7 +268,9 @@ class XmlDumpWriter { $out .= " \n"; } - Hooks::run( 'XmlDumpWriterWriteRevision', [ &$this, &$out, $row, $text ] ); + // Avoid PHP 7.1 warning from passing $this by reference + $writer = $this; + Hooks::run( 'XmlDumpWriterWriteRevision', [ &$writer, &$out, $row, $text ] ); $out .= " \n"; @@ -285,7 +286,6 @@ class XmlDumpWriter { * @access private */ function writeLogItem( $row ) { - $out = " \n"; $out .= " " . Xml::element( 'id', null, strval( $row->log_id ) ) . "\n"; @@ -431,6 +431,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 .= ':'; }