Followup to r45676, r45688, r45689, but this time actually working. :)
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 14 Jan 2009 19:56:42 +0000 (19:56 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 14 Jan 2009 19:56:42 +0000 (19:56 +0000)
For bug 16968 -- don't throw a filename change warning when we auto-capitalize the file per $wgCapitalLinks.

includes/specials/SpecialUpload.php

index e5a3cf9..adfea71 100644 (file)
@@ -504,10 +504,13 @@ class UploadForm {
                if ( ! $this->mIgnoreWarning ) {
                        $warning = '';
 
-                       global $wgCapitalLinks;
-                       if ( $wgCapitalLinks ) ucfirst( $basename );
+                       $comparableName = str_replace( ' ', '_', $basename );
+                       global $wgCapitalLinks, $wgContLang;
+                       if ( $wgCapitalLinks ) {
+                               $comparableName = $wgContLang->ucfirst( $comparableName );
+                       }
 
-                       if( str_replace( ' ', '_', $basename ) != $filtered ) {
+                       if( $comparableName !== $filtered ) {
                                $warning .=  '<li>'.wfMsgHtml( 'badfilename', htmlspecialchars( $this->mDestName ) ).'</li>';
                        }