Last modified: 2008-12-24 00:52:48 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 16772 - Special:Upload isn't normalizing spaces in file extension correctly
Special:Upload isn't normalizing spaces in file extension correctly
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Uploading (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
http://en.wikipedia.org/wiki/File:%22...
:
: 16512 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-23 17:17 UTC by Brion Vibber
Modified: 2008-12-24 00:52 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Brion Vibber 2008-12-23 17:17:07 UTC
Try uploading a file with a space in its extension:

1) Go to Special:Upload
2) Pick some .jpg file
3) Change the destination filename field to end in ". jpg" (note space between . and jpg)
4) Submit!

It should translate the " " to "_" immediately, then reject the file as a whole as "._jpg" is not recognized.

However, it seems to be allowing the upload through; file type is detected using the trimmed "jpg" form, but the web server of course doesn't know "._jpg" and serves it as a binary file which causes confusion.

Some on-wiki discussion:
http://en.wikipedia.org/wiki/Wikipedia:VPT#Image_does_not_display.2C_rather_attempts_to_download
Comment 1 Splarka 2008-12-23 18:27:25 UTC
Another oddity: With optional file renaming on, you can rename a file from "._jpg" to ".jpg" but you cannot rename it back, so whatever checks that works. ^_^

Should there not be one specific centralized function that detects extension (and overall filename) validity? Or consistency in the way it is used, at least?
Comment 2 Brion Vibber 2008-12-23 18:30:22 UTC
Offhand it looks like the problem is that on upload it's doing the extension validity check on the name *before* normalizing spaces to "_", and that check is doing a trim() on the extension after separating it from the ".".

So:

1) The "_" normalization should be done as a first step.

2) That trim() should be found and killed. ;)

And yes, the checks should probably be centralized more than they already are.
Comment 3 Charlotte Webb 2008-12-23 18:32:15 UTC
while we're on this subject can we also normalize all file extensions to three letters, lowercase?

i'd argue that allowing "Foobar.jpg", "Foobar.JPG", "Foobar.JPEG", etc. to be different files is a bug rather than a helpful feature.

what's that 2^3 + 2^4 = twenty-four possible files named "Foobar" in the same format? More?

course i probably have to File A Separate Ticket For This.
Comment 4 Splarka 2008-12-23 18:33:55 UTC
(In reply to comment #3)
> while we're on this subject can we also normalize all file extensions to three
> letters, lowercase?
> 

.djvu ?
Comment 5 Charlotte Webb 2008-12-23 18:41:44 UTC
> .djvu ?

Wikipedia says:

Filename extension 	.djvu, .djv

Don't know which one is preferred, or whether we even allow this format, but if we do we should pick one suffix to favor and normalize the other to it. 

Or maybe djvu is just a double entendre meaning that my complaint is a duplicate of some other bug (probably is, didn't check, never had any luck with the search anyway).
Comment 6 Brion Vibber 2008-12-23 18:43:21 UTC
File a separate bug for that, please. :)

(Note we do normalize extensions for deleted file storage. It's not necessarily the 3-letter variant that's normal [if a 3-letter variant exists!] but there is a preferred variant.)
Comment 7 Splarka 2008-12-23 18:49:16 UTC
(In reply to comment #5)
> Or maybe djvu is just a double entendre meaning that my complaint is a
> duplicate of some other bug (probably is, didn't check, never had any luck with
> the search anyway).

Possibly a dupe of bug 4421 or bug 12992 (note these are alternate proposals to a similar resolution).

Also, Plz friend me (since we're turning this into a social networking site). (this is a joke)
Comment 8 Alex Z. 2008-12-23 23:02:35 UTC
Fixed in r44987.
Comment 9 Platonides 2008-12-24 00:52:48 UTC
*** Bug 16512 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links