Page MenuHomePhabricator

Special:Upload gives tedious warning about changing spaces to underscores in file names
Closed, ResolvedPublic

Description

Author: brianna.laugher

Description:
Hi,

I have a feeling that this used to be fixed, but in recent weeks or months it seems to have reverted.

If you upload a file with a destination filename "Test name with spaces.png", and don't tick "ignore all warnings", you get this warning:

File name has been changed to "Test_name_with_spaces.png".

This warning is basically pointless and just encourages people to tick "ignore all warnings".

in SpecialUpload.php there is

global $wgCapitalLinks;
if( $wgCapitalLinks ) {
    $filtered = ucfirst( $filtered );
}
if( $basename != $filtered ) {
    $warning .=  '<li>'.wfMsgHtml( 'badfilename', htmlspecialchars( $this->mDestName ) ).'</li>';
}

should probably add something like

$filteredunderscores = str_replace(" ","_",$filtered);

and compare $basename to $filteredunderscores instead of $filtered.


Version: unspecified
Severity: enhancement

Details

Reference
bz16968

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:28 PM
bzimport set Reference to bz16968.
bzimport added a subscriber: Unknown Object (MLST).

Cleaned up in general in r45676

Note there were several followups to that to tweak the capitals behavior; linked from code review comments.

herd wrote:

*** Bug 17709 has been marked as a duplicate of this bug. ***

it's back in 1.16, maybe 1.15 too
Remove:

if( $basename != $filtered ) {

$warning .=  '<li>'.wfMsgHtml( 'badfilename', htmlspecialchars( $this->mDestName ) ).'</li>';

}

*Remove: Well, that's what I did. I guess it also checks for bad characters in general

Bryan.TongMinh wrote:

It was fixed somewhere along the way; at least in 1.17.