From 82a344c42cf7eaff2b896b0705a4a733e7a8e275 Mon Sep 17 00:00:00 2001 From: Kevin Levie Date: Fri, 14 Aug 2015 17:04:35 +0200 Subject: [PATCH] Allows to use arrays via the REST API --- api/class.api.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/api/class.api.php b/api/class.api.php index 7a5f72cdec..177da3eaff 100644 --- a/api/class.api.php +++ b/api/class.api.php @@ -177,9 +177,7 @@ class civicrm_api3 { public function remoteCall($entity, $action, $params = array()) { $fields = "key={$this->key}&api_key={$this->api_key}"; $query = $this->uri . "&entity=$entity&action=$action"; - foreach ($params as $k => $v) { - $fields .= "&$k=" . urlencode($v); - } + $fields .= '&' . http_build_query($params); if (function_exists('curl_init')) { // To facilitate debugging without leaking info, entity & action // are GET, other data is POST. -- 2.25.1