Page MenuHomePhabricator

MMV: Page is completely blacked out when accessing an invalid file name
Closed, ResolvedPublic

Description

Urls like,

https://en.wikipedia.org/wiki/Mike_Godwin#mediaviewer/File:T<ess.pdf

Result in a completely black page with discoverable way to get out and no commmunication as to what happened.

The console shows:

Uncaught Error: Unable to parse title VM299:35
Title VM299:35
RP.parseHash
RP.parseLocation VM320:90
MMVP.hash VM320:103
deferred
MMVB.isCSSReady

Presumably there is an instance of new mw.Title where it should use mw.Title.newFromText with a condition check to verify the title was not invalid. It is user input after all, and even if it would try to match the DOM element first, the DOM can also contain arbitrary elements that are made to look like mediawiki image frames, and in addition, title validation rules can change over time, and in addition, the js class is only an approximation to the sever-side variant. There's always a risk of it being looser or stricter, so always validate titles (unless maybe they come from the API or an mw.config value directly).

The page being completely black is more common actually, since it's the standard thing that happens if there's an uncaught exception anywhere. Looks like maybe the UI and logic aren't separated properly that it causes the UI to get stuck half-way when it's doing what looks like simple logic. It should probably set up more of the UI at once (e.g. don't put up a black dimmer without also, in the same atomic dom change, provide a way to get out of it).


Version: unspecified
Severity: major

Details

Reference
bz69893

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:35 AM
bzimport added a project: MediaViewer.
bzimport set Reference to bz69893.
bzimport added a subscriber: Unknown Object (MLST).
Gilles subscribed.

Mass-removing the Multimedia tag from MediaViewer tasks, as this is now being worked on by the Reading department, not Editing's Multimedia team.

At the moment the URL https://en.wikipedia.org/wiki/Mike_Godwin#mediaviewer/File:T<ess.pdf shows a back screen for a short moment and then shows the article again. In the JavaScript console there is the error message

Error: "Unable to parse title"

I guess the behavior is changed compared to original behavior of this task because now the exception is caught and the black screen is removed.

Is this task now solved?

Tgr claimed this task.

The way the error is communicated could be improved, but that would be a separate task.