Page MenuHomePhabricator

API's parse module should not silently override invalid title inputs
Closed, ResolvedPublic

Description

When action=parse receives an invalid title input, it defaults to returning:
<parse displaytitle="API">

This can be seen at http://en.wikipedia.org/w/api.php?action=parse&title=[a.

This behavior is unexpected and wrong.


Version: unspecified
Severity: normal

Details

Reference
bz28578

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 11:29 PM
bzimport set Reference to bz28578.

(In reply to comment #0)

This behavior is unexpected and wrong.

What should it do, in your opinion? Die with an error?

(In reply to comment #1)

(In reply to comment #0)

This behavior is unexpected and wrong.

What should it do, in your opinion? Die with an error?

Something like that, yes. It looks like the behavior of other modules that receive invalid titles is to mark the title as invalid (e.g., http://en.wikipedia.org/w/api.php?action=query&titles=abc|abc{). Perhaps doing the same here makes sense. I'm not sure what the correct behavior is, I just know that returning displaytitle="API" is wrong.

In this particular case, parsing can be (and is) context-specific (i.e., the title can definitely alter what is returned), so perhaps flatly dying with an error makes more sense.