From 08d0c34b7076db751ca6adb1d72638daf23e8474 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 13 Jan 2015 11:49:46 +1300 Subject: [PATCH] fix re-use of variable --- api/api.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/api.php b/api/api.php index b88dc5b278..9b7eb85ce2 100644 --- a/api/api.php +++ b/api/api.php @@ -127,10 +127,10 @@ function _civicrm_api_replace_variables(&$params, &$parentResult, $separator = ' foreach ($params as $field => $value) { if (is_string($value) && substr($value, 0, 6) == '$value') { - $valuesubstitute = substr($value, 7); + $valueSubstitute = substr($value, 7); - if (!empty($parentResult[$valuesubstitute])) { - $params[$field] = $parentResult[$valuesubstitute]; + if (!empty($parentResult[$valueSubstitute])) { + $params[$field] = $parentResult[$valueSubstitute]; } else { @@ -145,8 +145,8 @@ function _civicrm_api_replace_variables(&$params, &$parentResult, $separator = ' $fieldname .= "." . array_shift($stringParts); if (array_key_exists($fieldname, $parentResult) && is_array($parentResult[$fieldname])) { $arrayLocation = $parentResult[$fieldname]; - foreach ($stringParts as $key => $value) { - $arrayLocation = CRM_Utils_Array::value($value, $arrayLocation); + foreach ($stringParts as $key => $innerValue) { + $arrayLocation = CRM_Utils_Array::value($innerValue, $arrayLocation); } $params[$field] = $arrayLocation; } -- 2.25.1