r86270 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86269‎ | r86270 | r86271 >
Date:18:49, 17 April 2011
Author:mkroetzsch
Status:deferred
Tags:
Comment:
avoid exporting empty namespace strings
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/export/SMW_Exporter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/export/SMW_Exporter.php
@@ -250,8 +250,12 @@
251251 ( in_array( $localname[0], array( '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' ) ) ) ) {
252252 $namespace = '&wiki;';
253253 $namespaceid = 'wiki';
254 - $nsText = str_replace( ' ', '_', $wgContLang->getNSText( $diWikiPage->getNamespace() ) );
255 - $localname = SMWExporter::encodeURI( wfUrlencode( $nsText . ':' . $diWikiPage->getDBkey() ) );
 254+ if ( $diWikiPage->getNamespace() !== 0 ) {
 255+ $localname = str_replace( ' ', '_', $wgContLang->getNSText( $diWikiPage->getNamespace() ) ) . ":" . $diWikiPage->getDBkey();
 256+ } else {
 257+ $localname = $diWikiPage->getDBkey();
 258+ }
 259+ $localname = SMWExporter::encodeURI( wfUrlencode( $localname ) );
256260 }
257261 }
258262

Status & tagging log