Skip to content

Instantly share code, notes, and snippets.

@randronico
randronico / Curl.php
Created June 30, 2021 14:20 — forked from dfreerksen/Curl.php
PHP Curl helper class (PHP 5.2+)
<?php
class Curl
{
/**
* cURL request method
*
* @var string
*/
@randronico
randronico / Curl_20210624.patch
Last active July 2, 2021 14:30
Curl.php patch
diff --git a/Curl.php b/Curl.php
index 651a39b..1bc1ed2 100644
--- a/Curl.php
+++ b/Curl.php
@@ -365,17 +365,17 @@ class Curl
switch ($method) {
case 'GET' :
// Append GET params to URL
- $this->_url .= '?' . http_build_query($this->_params);
+ $this->_url .= http_build_query($this->_params) ? '?' . http_build_query($this->_params) : '';