X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fexport%2FXmlDumpWriter.php;h=5a1f92c4cc43c1fb16ffbd9460a023a07c2f09e0;hp=42168d7603cdc5ee65e22fd70c418b306338a844;hb=22806b0a4509e97b56fb52b387e17e3c80fb7eb2;hpb=a0803c9bc551631c8a35bf2d99705a724cb62039 diff --git a/includes/export/XmlDumpWriter.php b/includes/export/XmlDumpWriter.php index 42168d7603..5a1f92c4cc 100644 --- a/includes/export/XmlDumpWriter.php +++ b/includes/export/XmlDumpWriter.php @@ -38,7 +38,7 @@ class XmlDumpWriter { * @return string */ function openStream() { - global $wgLanguageCode; + global $wgContLang; $ver = WikiExporter::schemaVersion(); return Xml::element( 'mediawiki', [ 'xmlns' => "http://www.mediawiki.org/xml/export-$ver/", @@ -51,12 +51,12 @@ class XmlDumpWriter { * you copy in the new xsd file. * * After it is reviewed, merged and deployed (sync-docroot), the index.html needs purging. - * echo "http://www.mediawiki.org/xml/index.html" | mwscript purgeList.php --wiki=aawiki + * echo "https://www.mediawiki.org/xml/index.html" | mwscript purgeList.php --wiki=aawiki */ 'xsi:schemaLocation' => "http://www.mediawiki.org/xml/export-$ver/ " . "http://www.mediawiki.org/xml/export-$ver.xsd", 'version' => $ver, - 'xml:lang' => $wgLanguageCode ], + 'xml:lang' => $wgContLang->getHtmlCode() ], null ) . "\n" . $this->siteInfo(); @@ -269,7 +269,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"; @@ -431,6 +433,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 .= ':'; }