r45744 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45743‎ | r45744 | r45745 >
Date:19:56, 14 January 2009
Author:brion
Status:ok
Tags:
Comment:
Followup to r45676, r45688, r45689, but this time actually working. :)
For bug 16968 -- don't throw a filename change warning when we auto-capitalize the file per $wgCapitalLinks.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUpload.php
@@ -504,10 +504,13 @@
505505 if ( ! $this->mIgnoreWarning ) {
506506 $warning = '';
507507
508 - global $wgCapitalLinks;
509 - if ( $wgCapitalLinks ) ucfirst( $basename );
 508+ $comparableName = str_replace( ' ', '_', $basename );
 509+ global $wgCapitalLinks, $wgContLang;
 510+ if ( $wgCapitalLinks ) {
 511+ $comparableName = $wgContLang->ucfirst( $comparableName );
 512+ }
510513
511 - if( str_replace( ' ', '_', $basename ) != $filtered ) {
 514+ if( $comparableName !== $filtered ) {
512515 $warning .= '<li>'.wfMsgHtml( 'badfilename', htmlspecialchars( $this->mDestName ) ).'</li>';
513516 }
514517

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r45676(bug 16968) Don't throw useless warnings on Special:Upload. We don't warn the...demon14:28, 12 January 2009
r45688Remove this ucfirst() crap. $filtered is already a DB key, so it should've be...demon23:58, 12 January 2009
r45689bug 15470: Don't force-capitalize on Special:Upload. There's no point in thro...demon00:18, 13 January 2009

Status & tagging log