1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 04:20:55 +01:00

Check for null, strictly, in maniphest.update param validation

Summary:
If the first non-null entry in the params array is falsey, the request bombs.

Something like {"id":279,"projectPHIDs":[],"status":"0","ownerPHID":"PHID-USER-on3xxsnaljmfn36d4b7a"}

Test Plan:
Before:

  echo '{"id":279,"projectPHIDs":[],"status":"0","ownerPHID":"PHID-USER-cj3cpuh7oorbmnn2pl5g"}' | arc call-conduit maniphest.update
  {"error":"ERR-NO-EFFECT","errorMessage":"ERR-NO-EFFECT: Update has no effect.","response":null}

After:

  echo '{"id":279,"projectPHIDs":[],"status":"0","ownerPHID":"PHID-USER-cj3cpuh7oorbmnn2pl5g"}' | arc call-conduit maniphest.update
  {"error":null,"errorMessage":null,"response":{"id":"279","phid":"PHID-TASK-lbwcq3pmur2c5fuqqhlx"...

Reviewers: garoevans, epriestley, #blessed_reviewers

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Differential Revision: https://secure.phabricator.com/D8391
This commit is contained in:
Alex Wyler 2014-03-04 11:42:18 -08:00 committed by epriestley
parent fb87d0f491
commit 5fabda2a6d

View file

@ -49,9 +49,8 @@ final class ConduitAPI_maniphest_update_Method
$params = $request->getAllParameters();
unset($params['id']);
unset($params['phid']);
$params = call_user_func_array('coalesce', $params);
if (!$params) {
if (call_user_func_array('coalesce', $params) === null) {
throw new ConduitException('ERR-NO-EFFECT');
}