Differential D12680 Diff 30538 src/applications/conduit/controller/PhabricatorConduitAPIController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conduit/controller/PhabricatorConduitAPIController.php
| Show First 20 Lines • Show All 641 Lines • ▼ Show 20 Lines | if ($params !== null) { | ||||
| return array($metadata, $params); | return array($metadata, $params); | ||||
| } | } | ||||
| // Otherwise, look for a single parameter called 'params' which has the | // Otherwise, look for a single parameter called 'params' which has the | ||||
| // entire param dictionary JSON encoded. | // entire param dictionary JSON encoded. | ||||
| $params_json = $request->getStr('params'); | $params_json = $request->getStr('params'); | ||||
| if (strlen($params_json)) { | if (strlen($params_json)) { | ||||
| $params = json_decode($params_json, true); | $params = null; | ||||
| if (!is_array($params)) { | try { | ||||
| throw new Exception( | $params = phutil_json_decode($params_json); | ||||
| "Invalid parameter information was passed to method ". | } catch (PhutilJSONParserException $ex) { | ||||
| "'{$method}', could not decode JSON serialization. Data: ". | throw new PhutilProxyException( | ||||
| $params_json); | pht( | ||||
| "Invalid parameter information was passed to method '%s'", | |||||
| $method), | |||||
| $ex); | |||||
| } | } | ||||
| $metadata = idx($params, '__conduit__', array()); | $metadata = idx($params, '__conduit__', array()); | ||||
| unset($params['__conduit__']); | unset($params['__conduit__']); | ||||
| return array($metadata, $params); | return array($metadata, $params); | ||||
| } | } | ||||
| Show All 17 Lines | |||||