Merge "Handle missing namespace prefix in XML dumps more gracefully"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 8 Mar 2017 05:07:56 +0000 (05:07 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 8 Mar 2017 05:07:57 +0000 (05:07 +0000)
1  2 
includes/export/XmlDumpWriter.php

@@@ -269,9 -269,7 +269,9 @@@ class XmlDumpWriter 
                        $out .= "      <sha1/>\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 .= "    </revision>\n";
  
                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 .= ':';
                }