r45676 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45675‎ | r45676 | r45677 >
Date:14:28, 12 January 2009
Author:demon
Status:resolved (Comments)
Tags:
Comment:
(bug 16968) Don't throw useless warnings on Special:Upload. We don't warn the user about spaces/underscores anywhere else, why bother with it here? And if $wgCapitalLinks is enabled, we should silently deal with it, rather than make the user think they've done something wrong.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUpload.php
@@ -504,13 +504,14 @@
505505 if ( ! $this->mIgnoreWarning ) {
506506 $warning = '';
507507
 508+ if( str_replace( ' ', '_', $basename ) != $filtered ) {
 509+ $warning .= '<li>'.wfMsgHtml( 'badfilename', htmlspecialchars( $this->mDestName ) ).'</li>';
 510+ }
 511+
508512 global $wgCapitalLinks;
509513 if( $wgCapitalLinks ) {
510514 $filtered = ucfirst( $filtered );
511515 }
512 - if( $basename != $filtered ) {
513 - $warning .= '<li>'.wfMsgHtml( 'badfilename', htmlspecialchars( $this->mDestName ) ).'</li>';
514 - }
515516
516517 global $wgCheckFileExtensions;
517518 if ( $wgCheckFileExtensions ) {
Index: trunk/phase3/RELEASE-NOTES
@@ -38,6 +38,7 @@
3939 === Bug fixes in 1.15 ===
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)
 42+* (bug 16968) Special:Upload no longer throws useless warnings.
4243
4344 == API changes in 1.15 ==
4445 * (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

Comments

#Comment by Pfctdayelise (talk | contribs)   23:12, 12 January 2009

Shouldn't the "if( $wgCapitalLinks )" block still be above the badfilename warning block?

#Comment by 😂 (talk | contribs)   23:54, 12 January 2009

Come to think of it, it probably could be removed entirely. $filtered already is coming from a DB key, so it should be normalizing it to uppercase anyway. $basename is still going to != $filtered anytime $wgCapitalLinks is enabled and a lowercase target name is submitted.

#Comment by 😂 (talk | contribs)   23:58, 12 January 2009

Followed up in r45688

#Comment by Brion VIBBER (talk | contribs)   19:57, 14 January 2009

r45744 makes the caps thing work now. :)

Status & tagging log