to avoid query errors about duplicate keynames.
* (bug 24700) Update dialog shown when clicking on the special page tab after
saving preferences
+* (bug 15470) First letters of filenames are always capitalized by upload JS.
=== API changes in 1.17 ===
* (bug 22738) Allow filtering by action type on query=logevent.
$this->mDestFile === '',
'wgUploadSourceIds' => $this->mSourceIds,
'wgStrictFileExtensions' => $wgStrictFileExtensions,
+ 'wgCapitalizeUploads' => MWNamespace::isCapitalized( NS_FILE ),
);
$wgOut->addScript( Skin::makeVariablesScript( $scriptVars ) );
}
}
- // Capitalise first letter and replace spaces by underscores
- // FIXME: $wgCapitalizedNamespaces
- fname = fname.charAt(0).toUpperCase().concat(fname.substring(1,10000)).replace(/ /g, '_');
+ // Replace spaces by underscores
+ fname = fname.replace( / /g, '_' );
+ // Capitalise first letter if needed
+ if ( wgCapitalizeUploads ) {
+ fname = fname.charAt( 0 ).toUpperCase().concat( fname.substring( 1, 10000 ) );
+ }
// Output result
var destFile = document.getElementById('wpDestFile');