From 5fabda2a6db15e92480aeee8920288d8aa57839c Mon Sep 17 00:00:00 2001 From: Alex Wyler Date: Tue, 4 Mar 2014 11:42:18 -0800 Subject: [PATCH] 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 --- .../maniphest/conduit/ConduitAPI_maniphest_update_Method.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/applications/maniphest/conduit/ConduitAPI_maniphest_update_Method.php b/src/applications/maniphest/conduit/ConduitAPI_maniphest_update_Method.php index aeae252f55..ffe43cbd27 100644 --- a/src/applications/maniphest/conduit/ConduitAPI_maniphest_update_Method.php +++ b/src/applications/maniphest/conduit/ConduitAPI_maniphest_update_Method.php @@ -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'); }