From: Brion Vibber Date: Fri, 21 Dec 2007 17:49:30 +0000 (+0000) Subject: * (bug 12371) Handle more namespace case variants in namespaceDupes.php X-Git-Tag: 1.31.0-rc.0~50316 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=74dd4b69cfb9eb10e0b35af06f646947279c53a4;p=lhc%2Fweb%2Fwiklou.git * (bug 12371) Handle more namespace case variants in namespaceDupes.php --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 2fb29386c4..76654daaff 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -260,6 +260,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 12296) Simplify cache epoch in default LocalSettings.php * (bug 12346) XML fix when body double-click and click handlers are present * Fix regression -- missing feed links in sidebar on Special:Recentchanges +* (bug 12371) Handle more namespace case variants in namespaceDupes.php == Parser changes in 1.12 == diff --git a/maintenance/namespaceDupes.php b/maintenance/namespaceDupes.php index 4494aaba7d..d758a8581b 100644 --- a/maintenance/namespaceDupes.php +++ b/maintenance/namespaceDupes.php @@ -75,14 +75,29 @@ class NamespaceConflictChecker { $spaces[$name] = $ns; } - if( !$wgCapitalLinks ) { - // We'll need to check for lowercase keys as well, - // since we're doing case-sensitive searches in the db. - foreach( $spaces as $name => $ns ) { - $lcname = $wgContLang->lcfirst( $name ); - $spaces[$lcname] = $ns; + // We'll need to check for lowercase keys as well, + // since we're doing case-sensitive searches in the db. + foreach( $spaces as $name => $ns ) { + $moreNames = array(); + $moreNames[] = $wgContLang->uc( $name ); + $moreNames[] = $wgContLang->ucfirst( $wgContLang->lc( $name ) ); + $moreNames[] = $wgContLang->ucwords( $name ); + $moreNames[] = $wgContLang->ucwords( $wgContLang->lc( $name ) ); + $moreNames[] = $wgContLang->ucwordbreaks( $name ); + $moreNames[] = $wgContLang->ucwordbreaks( $wgContLang->lc( $name ) ); + if( !$wgCapitalLinks ) { + foreach( $moreNames as $altName ) { + $moreNames[] = $wgContLang->lcfirst( $altName ); + } + $moreNames[] = $wgContLang->lcfirst( $name ); + } + foreach( array_unique( $moreNames ) as $altName ) { + if( $altName !== $name ) { + $spaces[$altName] = $ns; + } } } + ksort( $spaces ); asort( $spaces );