Skip to content

Commit

Permalink
A fix for arrays in request query params #83
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-zahariev committed Mar 25, 2021
1 parent 5ceeafb commit 4584427
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ $ses = new SimpleEmailService('AccessKey', 'SecretKey', $region_endpoint, $trigg

### Changelog

v.0.9.5
* Fix for arrays in request query params (#83)

v.0.9.4
* Fix for PHP8 errors (#81)

Expand Down
4 changes: 2 additions & 2 deletions src/SimpleEmailService.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
*
* @link https://github.com/daniel-zahariev/php-aws-ses
* @package AmazonSimpleEmailService
* @version v0.9.4
* @version v0.9.5
*/
class SimpleEmailService
{
Expand Down Expand Up @@ -150,7 +150,7 @@ public function __construct($accessKey = null, $secretKey = null, $host = self::
* @deprecated Currently only V4 supported.
*/
public function setRequestSignatureVersion($requestSignatureVersion) {
$this->__requestSignatureVersion = self::REQUEST_SIGNATURE_V4;
$this->__requestSignatureVersion = $requestSignatureVersion;

return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion src/SimpleEmailServiceMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @link https://github.com/daniel-zahariev/php-aws-ses
* @package AmazonSimpleEmailService
* @version v0.9.4
* @version v0.9.5
*/
final class SimpleEmailServiceMessage {

Expand Down
7 changes: 5 additions & 2 deletions src/SimpleEmailServiceRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @link https://github.com/daniel-zahariev/php-aws-ses
* @package AmazonSimpleEmailService
* @version v0.9.4
* @version v0.9.5
*/
class SimpleEmailServiceRequest
{
Expand Down Expand Up @@ -81,6 +81,7 @@ public function setParameter($key, $value, $replace = true) {
* Get the params for the request
*
* @return array $params
* @deprecated
*/
public function getParametersEncoded() {
$params = array();
Expand Down Expand Up @@ -146,7 +147,8 @@ protected function getCurlHandler() {
public function getResponse() {

$url = 'https://'.$this->ses->getHost().'/';
$query = implode('&', $this->getParametersEncoded());
ksort($this->parameters);
$query = http_build_query($this->parameters, '', '&', PHP_QUERY_RFC1738);
$headers = $this->getHeaders($query);

$curl_handler = $this->getCurlHandler();
Expand Down Expand Up @@ -271,6 +273,7 @@ private function __responseWriteCallback($curl, $data) {
*
* @param string $var String to encode
* @return string
* @deprecated
*/
private function __customUrlEncode($var) {
return str_replace('%7E', '~', rawurlencode($var));
Expand Down

0 comments on commit 4584427

Please sign in to comment.