r70669 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70668‎ | r70669 | r70670 >
Date:06:35, 8 August 2010
Author:maxsem
Status:ok
Tags:
Comment:
(bug 15470) First letters of filenames are always capitalized by upload JS
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUpload.php (modified) (history)
  • /trunk/phase3/skins/common/upload.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/upload.js
@@ -271,9 +271,12 @@
272272 }
273273 }
274274
275 - // Capitalise first letter and replace spaces by underscores
276 - // FIXME: $wgCapitalizedNamespaces
277 - fname = fname.charAt(0).toUpperCase().concat(fname.substring(1,10000)).replace(/ /g, '_');
 275+ // Replace spaces by underscores
 276+ fname = fname.replace( / /g, '_' );
 277+ // Capitalise first letter if needed
 278+ if ( wgCapitalizeUploads ) {
 279+ fname = fname.charAt( 0 ).toUpperCase().concat( fname.substring( 1, 10000 ) );
 280+ }
278281
279282 // Output result
280283 var destFile = document.getElementById('wpDestFile');
Index: trunk/phase3/includes/specials/SpecialUpload.php
@@ -1056,6 +1056,7 @@
10571057 $this->mDestFile === '',
10581058 'wgUploadSourceIds' => $this->mSourceIds,
10591059 'wgStrictFileExtensions' => $wgStrictFileExtensions,
 1060+ 'wgCapitalizeUploads' => MWNamespace::isCapitalized( NS_FILE ),
10601061 );
10611062
10621063 $wgOut->addScript( Skin::makeVariablesScript( $scriptVars ) );
Index: trunk/phase3/RELEASE-NOTES
@@ -280,6 +280,7 @@
281281 to avoid query errors about duplicate keynames.
282282 * (bug 24700) Update dialog shown when clicking on the special page tab after
283283 saving preferences
 284+* (bug 15470) First letters of filenames are always capitalized by upload JS.
284285
285286 === API changes in 1.17 ===
286287 * (bug 22738) Allow filtering by action type on query=logevent.

Status & tagging log