* (bug 12371) Handle more namespace case variants in namespaceDupes.php
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 21 Dec 2007 17:49:30 +0000 (17:49 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 21 Dec 2007 17:49:30 +0000 (17:49 +0000)
RELEASE-NOTES
maintenance/namespaceDupes.php

index 2fb2938..76654da 100644 (file)
@@ -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 ==
index 4494aab..d758a85 100644 (file)
@@ -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 );