From c673814b81de2f0e7452ac1633accd5b82d0158e Mon Sep 17 00:00:00 2001 From: Jens Schuppe Date: Wed, 20 Mar 2024 10:29:21 +0100 Subject: [PATCH] Do not try to `explode()` return parameter when it already is an array --- Civi/RemoteToolsRequest.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Civi/RemoteToolsRequest.php b/Civi/RemoteToolsRequest.php index 72bce4c..b82aac4 100644 --- a/Civi/RemoteToolsRequest.php +++ b/Civi/RemoteToolsRequest.php @@ -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 = $this->original_request['return'] ?? []; + if (is_array($return)) { + return $return; + } + if (is_string($return)) { + return explode(',', $return); } else { return []; }