X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fexport%2FXmlDumpWriter.php;h=5a1f92c4cc43c1fb16ffbd9460a023a07c2f09e0;hp=5cea50ca7f2b9ab9f133f1783ad2b9981e8a5aca;hb=22806b0a4509e97b56fb52b387e17e3c80fb7eb2;hpb=155ee515d4c0cd3ecddf9f659d9edd84b284081f diff --git a/includes/export/XmlDumpWriter.php b/includes/export/XmlDumpWriter.php index 5cea50ca7f..5a1f92c4cc 100644 --- a/includes/export/XmlDumpWriter.php +++ b/includes/export/XmlDumpWriter.php @@ -51,7 +51,7 @@ 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", @@ -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"; @@ -405,7 +407,7 @@ class XmlDumpWriter { " " . $comment . "\n" . " " . Xml::element( 'filename', null, $file->getName() ) . "\n" . $archiveName . - " " . Xml::element( 'src', null, $file->getCanonicalURL() ) . "\n" . + " " . Xml::element( 'src', null, $file->getCanonicalUrl() ) . "\n" . " " . Xml::element( 'size', null, $file->getSize() ) . "\n" . " " . Xml::element( 'sha1base36', null, $file->getSha1() ) . "\n" . " " . Xml::element( 'rel', null, $file->getRel() ) . "\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 .= ':'; }