From ca96ac6071fb7481d06787afe4f75bf5d50ece1b Mon Sep 17 00:00:00 2001 From: Diego Brito Sousa Date: Mon, 26 May 2014 13:04:01 -0300 Subject: [PATCH] Update Curl post query Post query building has been simplified. --- cexapi.class.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/cexapi.class.php b/cexapi.class.php index 5a77433..6cff076 100644 --- a/cexapi.class.php +++ b/cexapi.class.php @@ -58,14 +58,7 @@ private function nonce() { * @return array JSON results */ private function post($url, $param = array()) { - $post = ''; - if (!empty($param)) { - foreach($param as $k => $v) { - $post .= $k . '=' . $v . '&'; //Dirty, but work - } - - $post = substr($post, 0, strlen($post)-1); - } + $post = http_build_query($param); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url);