Page MenuHomePhabricator

Special:UploadWizard gives undescriptive error message upon too long filename
Closed, DuplicatePublic

Description

When choosing a filename which is too long in UW the resulting error message is mwe-upwiz-unparseable-title which mentions nothing about file length.

A quick fix would be to add the file length restriction to that error message. A better solution would be to have a separate error (in UW and in the API) for too long titles compared to titles containing illegal characters.

It would also seem that UW allows for longer filenames than Special:Upload (i.e. before T87313 kicks in). Could possibly be due to length checking being with file extension in Special:Upload but without it in UW.

Event Timeline

Lokal_Profil raised the priority of this task from to Needs Triage.
Lokal_Profil updated the task description. (Show Details)
Lokal_Profil added a subscriber: Lokal_Profil.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 21 2015, 10:43 AM
Aklapper renamed this task from Special:UploadWizard gives undescriptive erro message upon too long filename to Special:UploadWizard gives undescriptive error message upon too long filename.Jan 24 2015, 1:54 AM
Aklapper set Security to None.
Sn1per claimed this task.Jan 24 2015, 2:03 AM
Sn1per added a subscriber: Sn1per.

:)

Tgr added a subscriber: Tgr.Jan 24 2015, 2:19 AM

UW checks whether mw.Title.newFromText() is successful, and that function just returns false whether the title is too long or has invalid characters or whatever else, so I would say this has to be solved in core. (Not sure how though - maybe by mw.Title providing a validator that uses the same logic but returns error codes?)

Could possibly be due to length checking being with file extension in Special:Upload but without it in UW.

Or (UTF-16) characters vs. bytes? Haven't looked at the code, just guessing.

Sn1per added a comment.Feb 7 2015, 5:38 PM

So maybe the logic would be:
Use newFromTitle() to check the title, if newFromTitle() returns false, use a validator function on the title to check what error it was? newFromTitle() could use the validator to check the title internally so we wouldn't have two copies of the "valid title" checks.

Sn1per triaged this task as Low priority.Feb 13 2015, 9:35 PM

It doesn't look like this is still an issue. It's now calling mw.Title.newFromFileName to auto-sanitize it (plus some additional UW-specific sanitization).

See also T66912: UploadWizard: Accept files whose names are invalid MediaWiki titles

Re-open if this is still present.