Skip to content

Commit

Permalink
fix a bug where if the 'fields' key is a single value implode() throw…
Browse files Browse the repository at this point in the history
…s an error
  • Loading branch information
HelgeSverre committed Oct 15, 2018
1 parent 9673e8a commit 9818dca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/guilty/recman/RecmanApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ protected function buildUrl($params)
protected function prepareFieldParams($params)
{
if (isset($params["fields"])) {
return implode(",", $params["fields"]);
if (is_array($params["fields"])) {
return implode(",", $params["fields"]);
} else {
return $params["fields"];
}
}

return null;
Expand Down

0 comments on commit 9818dca

Please sign in to comment.