From 23da83490a17dd72d75166c5307e760a7b8d856c Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Tue, 15 Jun 2010 13:47:38 +0000 Subject: [PATCH] Fix bug 16356. Use proper normalization for dumpInterwiki.inc It was previously breaking on multibyte characters and space characters in interwiki entries. Patch by User:Umherirrender, Review by ^demon --- CREDITS | 1 + RELEASE-NOTES | 1 + maintenance/dumpInterwiki.inc | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CREDITS b/CREDITS index 7b24692378..10a77d417b 100644 --- a/CREDITS +++ b/CREDITS @@ -127,6 +127,7 @@ following names for their contribution to the product. * Str4nd * svip * Tisane +* Umherirrender * Zachary Hauri == Translators == diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 35520832ff..8224914609 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -196,6 +196,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN accidently activated when hitting enter. * (bug 23845) Special:ListFiles now uses correct file names without underscores * Ask for permanent login in Special:Preferences only if $wgCookieExpiration > 0 +* (bug 16356) Repair dumpInterwiki.inc to use proper normalization. === API changes in 1.17 === * (bug 22738) Allow filtering by action type on query=logevent. diff --git a/maintenance/dumpInterwiki.inc b/maintenance/dumpInterwiki.inc index 1f8bb55e06..97e5be99dd 100644 --- a/maintenance/dumpInterwiki.inc +++ b/maintenance/dumpInterwiki.inc @@ -29,7 +29,7 @@ class Site { } function getRebuildInterwikiDump() { - global $langlist, $languageAliases, $prefixRewrites; + global $langlist, $languageAliases, $prefixRewrites, $wgContLang; # Multi-language sites # db suffix => db suffix, iw prefix, hostname @@ -102,6 +102,8 @@ function getRebuildInterwikiDump() { # Global iterwiki map foreach ( $lines as $line ) { if ( preg_match( '/^\|\s*(.*?)\s*\|\|\s*(.*?)\s*$/', $line, $matches ) ) { + $prefix = $wgContLang->lc( $matches[1] ); + $prefix = str_replace( ' ', '_', $prefix ); $prefix = strtolower( $matches[1] ); $url = $matches[2]; if ( preg_match( '/(wikipedia|wiktionary|wikisource|wikiquote|wikibooks|wikimedia)\.org/', $url ) ) { -- 2.20.1