From 56d21334d73dd540332d4f7266cc42aa1b61fd2a Mon Sep 17 00:00:00 2001 From: atymic Date: Sun, 1 Dec 2019 11:11:19 +1100 Subject: [PATCH] fix: fix array to string on passing DM object --- tmhOAuth.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tmhOAuth.php b/tmhOAuth.php index e389331..cad6989 100644 --- a/tmhOAuth.php +++ b/tmhOAuth.php @@ -358,8 +358,10 @@ private function prepare_params() { foreach ($params as $k => $v) { $k = $this->request_settings['multipart'] ? $k : $this->safe_encode($k); - if (is_array($v)) - $v = implode(',', $v); + if (is_array($v)) { + $containsOnlyStrings = count(array_filter($v, 'is_string')) === count($v); + $v = $containsOnlyStrings ? implode(',', $v) : $v; + } // we don't need to do the multipart escaping if we support curlfile if ($supports_curl_file && ($v instanceof CurlFile)) {