From eb59f4c455188639ddbb1bf55214c7db115d26f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emir=20Kars=CC=A7=C4=B1yakal=C4=B1?= Date: Mon, 9 Nov 2015 15:45:34 +0200 Subject: [PATCH 1/2] query param building --- src/Sendloop/SendloopAPI3.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Sendloop/SendloopAPI3.php b/src/Sendloop/SendloopAPI3.php index 00cc74e..6244569 100644 --- a/src/Sendloop/SendloopAPI3.php +++ b/src/Sendloop/SendloopAPI3.php @@ -55,11 +55,7 @@ public function run($APICommand,$Parameters) { $APIURL = $this->MakeURL($APICommand); - $ParametersArray = array('APIKey='.$this->APIKey); - foreach ($Parameters as $Key => $Value) { - $ParametersArray[] = "$Key=$Value"; - } - $ParametersString = implode('&',$ParametersArray); + $ParametersString = http_build_query($Parameters) . "&APIKey=$this->APIKey"; curl_setopt($cURL,CURLOPT_URL,$APIURL); curl_setopt($cURL,CURLOPT_POST,1); From d0e3d2cc878491c46d9fa78c7548ffac8b80b4ab Mon Sep 17 00:00:00 2001 From: Guven Date: Wed, 13 Jan 2016 12:26:45 +0200 Subject: [PATCH 2/2] echoed lines deleted --- src/Sendloop/SendloopAPI3.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Sendloop/SendloopAPI3.php b/src/Sendloop/SendloopAPI3.php index 6244569..1ae4322 100644 --- a/src/Sendloop/SendloopAPI3.php +++ b/src/Sendloop/SendloopAPI3.php @@ -22,13 +22,11 @@ public function __construct($APIKey,$Subdomain,$ResponseFormat='json') { $this->SetResponseFormat($ResponseFormat); if (empty($APIKey)) { - echo 'APIKey is empty'; return false; } $this->APIKey = $APIKey; if (empty($Subdomain)) { - echo 'Subdomain is empty'; return false; } $this->Subdomain = $Subdomain; @@ -76,4 +74,4 @@ public function run($APICommand,$Parameters) { } -} \ No newline at end of file +}