Differential D25268 Diff 908 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 676 Lines • ▼ Show 20 Lines | if ($params !== null) { | ||||
$metadata = idx($params, '__conduit__', array()); | $metadata = idx($params, '__conduit__', array()); | ||||
unset($params['__conduit__']); | unset($params['__conduit__']); | ||||
return array($metadata, $params, true); | return array($metadata, $params, true); | ||||
} | } | ||||
// 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'); | ||||
valerio.bozzolan: Another potential minimal change without using phutil:
```lang=php
$params_json = $request… | |||||
aviveyUnsubmitted Not Done Inline ActionsMaybe '' should just be the default return value from getStr(), so it's never null? avivey: Maybe `''` should just be the default return value from `getStr()`, so it's never null? | |||||
speckUnsubmitted Not Done Inline ActionsPossibly but it’s a potentially larger change to also verify things that are expecting only null (and not empty string) as a return value if it’s unspecified. speck: Possibly but it’s a potentially larger change to also verify things that are expecting only… | |||||
if (strlen($params_json)) { | if (phutil_nonempty_string($params_json)) { | ||||
$params = null; | $params = null; | ||||
try { | try { | ||||
$params = phutil_json_decode($params_json); | $params = phutil_json_decode($params_json); | ||||
} catch (PhutilJSONParserException $ex) { | } catch (PhutilJSONParserException $ex) { | ||||
throw new PhutilProxyException( | throw new PhutilProxyException( | ||||
pht( | pht( | ||||
"Invalid parameter information was passed to method '%s'.", | "Invalid parameter information was passed to method '%s'.", | ||||
$method), | $method), | ||||
▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0
Another potential minimal change without using phutil: