r45689 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45688‎ | r45689 | r45690 >
Date:00:18, 13 January 2009
Author:demon
Status:reverted (Comments)
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (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
@@ -131,8 +131,8 @@
132132 fname = path.substring(backslash+1, 10000);
133133 }
134134
135 - // Capitalise first letter and replace spaces by underscores
136 - fname = fname.charAt(0).toUpperCase().concat(fname.substring(1,10000)).replace(/ /g, '_');
 135+ // Replace spaces by underscores
 136+ fname = fname.replace(/ /g, '_');
137137
138138 // Output result
139139 var destFile = document.getElementById('wpDestFile');
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1455,7 +1455,7 @@
14561456 * to ensure that client-side caches don't keep obsolete copies of global
14571457 * styles.
14581458 */
1459 -$wgStyleVersion = '196';
 1459+$wgStyleVersion = '197';
14601460
14611461
14621462 # Server-side caching:
Index: trunk/phase3/includes/specials/SpecialUpload.php
@@ -504,6 +504,9 @@
505505 if ( ! $this->mIgnoreWarning ) {
506506 $warning = '';
507507
 508+ global $wgCapitalLinks;
 509+ if ( $wgCapitalLinks ) ucfirst( $basename );
 510+
508511 if( str_replace( ' ', '_', $basename ) != $filtered ) {
509512 $warning .= '<li>'.wfMsgHtml( 'badfilename', htmlspecialchars( $this->mDestName ) ).'</li>';
510513 }
Index: trunk/phase3/RELEASE-NOTES
@@ -39,6 +39,7 @@
4040 * Fixing the caching issue by using -{T|xxx}- syntax (only applies on wiki with LanguageConverter class)
4141 * Improving the efficiency by using -{A|xxx}- syntax (only applies on wiki with LanguageConverter class)
4242 * (bug 16968) Special:Upload no longer throws useless warnings.
 43+* (bug 15470) Special:Upload no longer force-capitalizes titles
4344
4445 == API changes in 1.15 ==
4546 * (bug 16798) JSON encoding errors for some characters outside the BMP

Follow-up revisions

RevisionCommit summaryAuthorDate
r45744Followup to r45676, r45688, r45689, but this time actually working. :)...brion19:56, 14 January 2009
r45745Partial revert of r45689 "bug 15470: Don't force-capitalize on Special:Upload...brion20:03, 14 January 2009

Comments

#Comment by Brion VIBBER (talk | contribs)   20:04, 14 January 2009

Partial revert in r45745: 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.

The attempt to avoid the warning for auto-capitalization is now actually working in r45744.

Status & tagging log