Skip to content

Commit

Permalink
Merge pull request themattharris#1 from atymic/fix-array-to-string-error
Browse files Browse the repository at this point in the history
fix: fix array to string on passing DM object
  • Loading branch information
atymic authored Dec 1, 2019
2 parents 455552d + 56d2133 commit c68a2fc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tmhOAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit c68a2fc

Please sign in to comment.