Skip to content
This repository has been archived by the owner on May 24, 2019. It is now read-only.

Commit

Permalink
json encode bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Badi committed Sep 3, 2015
1 parent bfcc483 commit d269529
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Mailjet/php-mailjet-v3-simple.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function curl_setopt_custom_postfields($curl_handle, $postfields, $header
$body[] = 'Content-Type: application/octet-stream';
$body[] = '';
$body[] = file_get_contents($path);
}
}
// Array of recipients
else if ('to' == $key || 'cc' == $key || 'bcc' == $key) {
$body[] = '--' . $boundary;
Expand Down Expand Up @@ -352,7 +352,7 @@ public function sendRequest($resource = false, $params = array(), $request = "GE
if (($request == 'POST') || ($request == 'PUT')):
curl_setopt($curl_handle, CURLOPT_POST, 1);

// Exclude filters from payload. See http://stackoverflow.com/questions/4260086/php-how-to-use-array-filter-to-filter-array-keys
// Exclude filters from payload. See http://stackoverflow.com/questions/4260086/php-how-to-use-array-filter-to-filter-array-keys
$paramsFiltered = array_filter(array_keys($params), function($k) {
return substr($k, 0, 1) != '_';
});
Expand Down Expand Up @@ -392,7 +392,7 @@ public function sendRequest($resource = false, $params = array(), $request = "GE
unset($params['ID']);
}

curl_setopt($curl_handle, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, json_encode($params, JSON_UNESCAPED_SLASHES));
curl_setopt($curl_handle, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json'
));
Expand Down

0 comments on commit d269529

Please sign in to comment.