X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=api%2Fapi.php;h=8208af08db30d36f42b8a9e653f983f18bd69e62;hb=071863f759a5968cb64011c52f2ec75796f09599;hp=7cbc5d180dcb56f88b29b805d538a6e4bcaaf1fc;hpb=ec657f370948a0df869b7e518fdc82ddb10162c1;p=civicrm-core.git diff --git a/api/api.php b/api/api.php index 7cbc5d180d..8208af08db 100644 --- a/api/api.php +++ b/api/api.php @@ -184,12 +184,7 @@ function _civicrm_api3_api_getfields(&$apiRequest) { * true if error, false otherwise */ function civicrm_error($result) { - if (is_array($result)) { - return (array_key_exists('is_error', $result) && - $result['is_error'] - ) ? TRUE : FALSE; - } - return FALSE; + return is_array($result) && !empty($result['is_error']); } /** @@ -200,7 +195,7 @@ function civicrm_error($result) { * @return string|null */ function _civicrm_api_get_camel_name($entity) { - return is_string($entity) ? CRM_Utils_String::convertStringToCamel($entity) : NULL; + return is_string($entity) ? \Civi\API\Request::normalizeEntityName($entity) : NULL; } /** @@ -267,7 +262,7 @@ function _civicrm_api_replace_variable($value, $parentResult, $separator) { if (array_key_exists($fieldname, $parentResult) && is_array($parentResult[$fieldname])) { $arrayLocation = $parentResult[$fieldname]; foreach ($stringParts as $key => $innerValue) { - $arrayLocation = CRM_Utils_Array::value($innerValue, $arrayLocation); + $arrayLocation = $arrayLocation[$innerValue] ?? NULL; } $value = $arrayLocation; }