Partial revert of r45689 "bug 15470: Don't force-capitalize on Special:Upload. There...
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 14 Jan 2009 20:03:40 +0000 (20:03 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 14 Jan 2009 20:03:40 +0000 (20:03 +0000)
This made the auto-filled destination file name no longer match what we would actually upload as. It would be better to make it *more* accurate (handling normalization of forbidden chars) rather than less accurate.
The particular problem of bug 15470 should be resolved by actually checking how normalization should proceed, not by failing to do it.

RELEASE-NOTES
skins/common/upload.js

index ae49192..06621c7 100644 (file)
@@ -37,7 +37,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   
 === Bug fixes in 1.15 ===
 * (bug 16968) Special:Upload no longer throws useless warnings.
-* (bug 15470) Special:Upload no longer force-capitalizes titles
 * (bug 17000) Special:RevisionDelete now checks if the database is locked before
   trying to delete the edit.
 * (bug 16852) padleft and padright now handle multibyte characters correctly
index 532d167..d1cf4b3 100644 (file)
@@ -131,8 +131,8 @@ function fillDestFilename(id) {
                fname = path.substring(backslash+1, 10000);
        }
 
-       // Replace spaces by underscores
-       fname = fname.replace(/ /g, '_');
+       // Capitalise first letter and replace spaces by underscores
+       fname = fname.charAt(0).toUpperCase().concat(fname.substring(1,10000)).replace(/ /g, '_');
 
        // Output result
        var destFile = document.getElementById('wpDestFile');