From 78253fcb467b2c32be4fa32e12e428b735ee0e73 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Tue, 13 Jan 2009 00:18:40 +0000 Subject: [PATCH] bug 15470: Don't force-capitalize on Special:Upload. There's no point in throwing errors for any of this crap, really. I think this cleans up the last of the useless errors (for spacing/capitalization) in Special:Upload. --- RELEASE-NOTES | 1 + includes/DefaultSettings.php | 2 +- includes/specials/SpecialUpload.php | 3 +++ skins/common/upload.js | 4 ++-- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 3a3f53aedf..a0e2b98488 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -39,6 +39,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Fixing the caching issue by using -{T|xxx}- syntax (only applies on wiki with LanguageConverter class) * Improving the efficiency by using -{A|xxx}- syntax (only applies on wiki with LanguageConverter class) * (bug 16968) Special:Upload no longer throws useless warnings. +* (bug 15470) Special:Upload no longer force-capitalizes titles == API changes in 1.15 == * (bug 16798) JSON encoding errors for some characters outside the BMP diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index e56713b44e..d849910d78 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1455,7 +1455,7 @@ $wgCacheEpoch = '20030516000000'; * to ensure that client-side caches don't keep obsolete copies of global * styles. */ -$wgStyleVersion = '196'; +$wgStyleVersion = '197'; # Server-side caching: diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 51f31c4155..7a92f9b1ad 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -504,6 +504,9 @@ class UploadForm { if ( ! $this->mIgnoreWarning ) { $warning = ''; + global $wgCapitalLinks; + if ( $wgCapitalLinks ) ucfirst( $basename ); + if( str_replace( ' ', '_', $basename ) != $filtered ) { $warning .= '
  • '.wfMsgHtml( 'badfilename', htmlspecialchars( $this->mDestName ) ).'
  • '; } diff --git a/skins/common/upload.js b/skins/common/upload.js index d1cf4b3ee7..532d1676e5 100644 --- a/skins/common/upload.js +++ b/skins/common/upload.js @@ -131,8 +131,8 @@ function fillDestFilename(id) { fname = path.substring(backslash+1, 10000); } - // Capitalise first letter and replace spaces by underscores - fname = fname.charAt(0).toUpperCase().concat(fname.substring(1,10000)).replace(/ /g, '_'); + // Replace spaces by underscores + fname = fname.replace(/ /g, '_'); // Output result var destFile = document.getElementById('wpDestFile'); -- 2.20.1