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

Implement option 1 from T3210

Summary: Fixes T3210

Test Plan: Run the conduit call via the UI and ensure it no longer breaks. Check I get an error returned if no params are set

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T3210

Differential Revision: https://secure.phabricator.com/D5950
This commit is contained in:
Gareth Evans 2013-05-17 04:13:58 -07:00 committed by epriestley
parent 27a0265367
commit 1dd91bde1f

View file

@ -13,7 +13,8 @@ final class ConduitAPI_maniphest_update_Method
public function defineErrorTypes() { public function defineErrorTypes() {
return array( return array(
'ERR-BAD-TASK' => 'No such maniphest task exists.', 'ERR-BAD-TASK' => 'No such maniphest task exists.',
'ERR-INVALID-PARAMETER' => 'Missing or malformed parameter.' 'ERR-INVALID-PARAMETER' => 'Missing or malformed parameter.',
'ERR-NO-EFFECT' => 'Update has no effect.',
); );
} }
@ -41,6 +42,15 @@ final class ConduitAPI_maniphest_update_Method
$phid); $phid);
} }
$params = $request->getAllParameters();
unset($params['id']);
unset($params['phid']);
$params = call_user_func_array('coalesce', $params);
if (!$params) {
throw new ConduitException('ERR-NO-EFFECT');
}
if (!$task) { if (!$task) {
throw new ConduitException('ERR-BAD-TASK'); throw new ConduitException('ERR-BAD-TASK');
} }