From 157858a2a7234cfa2e2a42c7455e9dba9bcd1753 Mon Sep 17 00:00:00 2001 From: icemanpro Date: Thu, 9 Apr 2015 09:44:13 +0800 Subject: [PATCH 1/2] Update Curl.php --- src/Curl/Curl.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Curl/Curl.php b/src/Curl/Curl.php index 814fbff..4d57543 100644 --- a/src/Curl/Curl.php +++ b/src/Curl/Curl.php @@ -62,7 +62,10 @@ public function post($url, $data = array()) { $this->setopt(CURLOPT_URL, $url); $this->setopt(CURLOPT_POST, true); + if (count($data)>0) + { $data = http_build_query($data); + } $this->setopt(CURLOPT_POSTFIELDS, $data); $this->_exec(); } From b6058445d2f51cb92d818ca63c5d9dbd3002129f Mon Sep 17 00:00:00 2001 From: icemanpro Date: Thu, 9 Apr 2015 09:50:05 +0800 Subject: [PATCH 2/2] Update Curl.php --- src/Curl/Curl.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Curl/Curl.php b/src/Curl/Curl.php index 4d57543..8d648cd 100644 --- a/src/Curl/Curl.php +++ b/src/Curl/Curl.php @@ -62,10 +62,10 @@ public function post($url, $data = array()) { $this->setopt(CURLOPT_URL, $url); $this->setopt(CURLOPT_POST, true); - if (count($data)>0) - { - $data = http_build_query($data); - } + if (is_array($data) || is_object($data)) + { + $data = http_build_query($data); + } $this->setopt(CURLOPT_POSTFIELDS, $data); $this->_exec(); }