From: Chuck Hagenbuch Date: Sun, 27 Sep 2009 16:25:10 +0000 (-0400) Subject: fix Curl requests defaulting to POST instead of GET (and otherwise ignoring the X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=2cea057b4bafe2ed2fbf20b0da52b084f37658dc;p=horde.git fix Curl requests defaulting to POST instead of GET (and otherwise ignoring the request method) --- diff --git a/framework/Http/lib/Horde/Http/Request/Curl.php b/framework/Http/lib/Horde/Http/Request/Curl.php index 0b1ac8805..56ddefa49 100644 --- a/framework/Http/lib/Horde/Http/Request/Curl.php +++ b/framework/Http/lib/Horde/Http/Request/Curl.php @@ -36,6 +36,7 @@ class Horde_Http_Request_Curl extends Horde_Http_Request_Base curl_setopt($curl, CURLOPT_URL, $this->uri); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HEADER, true); + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $this->method); $data = $this->data; if (is_array($data)) { @@ -44,7 +45,7 @@ class Horde_Http_Request_Curl extends Horde_Http_Request_Base // POST data isn't passed. $data = http_build_query($data); } - curl_setopt($curl, CURLOPT_POSTFIELDS, $this->data); + if ($data) { curl_setopt($curl, CURLOPT_POSTFIELDS, $data); } $result = curl_exec($curl); if ($result === false) {