Page MenuHomePhabricator

UploadWizard throws “Error: Unable to parse title“ when a URL parameter (categories) contains characters not allowed in page titles
Closed, ResolvedPublic

Description

Steps to reproduce:

Error: https://commons.wikimedia.org/w/load.php?debug=false&lang=fr&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=T5zOVd1J line 4 > eval at line 21: Error: Unable to parse title

Use case was Wiki Loves Monuments lists like fr:Liste des monuments historiques de Lyon who try to be smart and prefill stuff as much as possible.

Details

Related Gerrit Patches:
mediawiki/extensions/UploadWizard : wmf/1.26wmf22Don't fail horribly when invalid categories are passed
mediawiki/extensions/UploadWizard : masterDon't fail horribly when invalid categories are passed

Event Timeline

JeanFred raised the priority of this task from to Needs Triage.
JeanFred updated the task description. (Show Details)
JeanFred added a project: UploadWizard.
JeanFred added a subscriber: JeanFred.
Restricted Application added a project: Multimedia. · View Herald TranscriptSep 12 2015, 10:59 PM
Restricted Application added subscribers: Steinsplitter, Aklapper. · View Herald Transcript
JeanFred updated the task description. (Show Details)Sep 12 2015, 11:00 PM
JeanFred set Security to None.
Restricted Application added a subscriber: Matanya. · View Herald TranscriptSep 12 2015, 11:00 PM

Looks like the culprit (in this case at lease) is the '<' character.

Also occurs when trying to escape characters (using mw.uri.encode)

https://commons.wikimedia.org/wiki/Special:UploadWizard?categories=1%253Earrondissement

matmarex claimed this task.Sep 13 2015, 6:11 PM
matmarex renamed this task from UploadWizard throws “Error: Unable to parse title“ when a URL parameter (categories) contains badly escaped characters to UploadWizard throws “Error: Unable to parse title“ when a URL parameter (categories) contains characters not allowed in page titles.Sep 14 2015, 4:31 PM
Jdforrester-WMF triaged this task as High priority.Sep 14 2015, 4:40 PM
Jdforrester-WMF moved this task from Untriaged to Doing on the Multimedia board.

Change 238219 had a related patch set uploaded (by Bartosz Dziewoński):
Don't fail horribly when invalid categories are passed

https://gerrit.wikimedia.org/r/238219

Change 238219 merged by jenkins-bot:
Don't fail horribly when invalid categories are passed

https://gerrit.wikimedia.org/r/238219

matmarex closed this task as Resolved.Sep 15 2015, 11:56 AM
matmarex reopened this task as Open.Sep 15 2015, 12:32 PM
matmarex added a subscriber: matmarex.

Reopening until the fix is deployed on Commons.

By the way, the real issue here is that the parameter value is not valid. 1%3Csup%3Eer%3C%2Fsup%3E+arrondissement is "1<sup>er</sup> arrondissement", which is not a valid category name (or page title). You should fix whatever is generating the problematic URL. My fix makes UploadWizard just ignore the invalid value, rather than break entirely (like you said, the exception causes it to land in a state where you can't do anything).

Change 238421 had a related patch set uploaded (by Bartosz Dziewoński):
Don't fail horribly when invalid categories are passed

https://gerrit.wikimedia.org/r/238421

Jdforrester-WMF moved this task from Doing to Done on the Multimedia board.Sep 15 2015, 3:19 PM

Change 238421 merged by jenkins-bot:
Don't fail horribly when invalid categories are passed

https://gerrit.wikimedia.org/r/238421

matmarex closed this task as Resolved.Sep 15 2015, 3:43 PM

Deployed now.