Skip to content

Commit

Permalink
Do not try to explode() return parameter when it already is an array
Browse files Browse the repository at this point in the history
  • Loading branch information
jensschuppe committed Mar 14, 2024
1 parent 3aa7846 commit 5710fea
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Civi/RemoteToolsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,12 @@ public function wasExecuted()
*/
public function getOriginalReturnFields()
{
$return_string = \CRM_Utils_Array::value('return', $this->original_request, '');
if ($return_string) {
return explode(',', $return_string);
$return = \CRM_Utils_Array::value('return', $this->original_request, '');
if (is_array($return)) {
return $return;
}
if (is_string($return)) {
return explode(',', $return);
} else {
return [];
}
Expand Down

0 comments on commit 5710fea

Please sign in to comment.