Constraints parameter type handling in maniphest.search

#1

Observed Behavior:
When calling the maniphest.search API with a constraints parameter set the wrong way (you’ll see below), Phabricator returns what appears to be a truncated PHP error message.

Expected Behavior:
Phabricator should return it’s own error about this being invalid input.

Phabricator Version:
I originally encountered this on Wikimedia Phabricator which I believe is on the 2019 Week 11 release so fairly recent, but I also reproduced it on secure.phabricator.com which I assume you know the version of (I found I’m not able to open tasks there anymore but can still log in and test stuff like this).

Reproduction Steps:

  • Get a Conduit API token
  • curl 'https://secure.phabricator.com/api/maniphest.search?api.token=redacted&constraints=%7B%22statuses%22%3A+%5B%22resolved%22%5D%7D'
  • Response body will be something like:
    {"result":null,"error_code":"ERR-CONDUIT-CORE","error_info":"Argument 1 passed to PhabricatorSearchField::getValueExistsInConduitRequest() must be of the type array, string given, called in \/core\/lib\/phabricator\/src\/applications\/search\/engine\/PhabricatorApplicationSearchEngine.php on line 1171 and defined"}

Side note: I know now this is not how you set such parameters. This bug report is about Phabricator returning a PHP error, instead of noticing the problem and handling it properly (by returning a decent error message). I also didn’t originally use curl for this, it just makes for simpler reproduction steps.

0 Likes

#2

Thanks! See https://secure.phabricator.com/D20429.

0 Likes

closed #3
0 Likes