From: Chuck Hagenbuch Date: Wed, 9 Sep 2009 01:51:53 +0000 (-0400) Subject: Make sure we don't accidentally trigger curl's file uploading X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=b83d45d714e97f65edb57597f15640406825273d;p=horde.git Make sure we don't accidentally trigger curl's file uploading --- diff --git a/framework/Http/lib/Horde/Http/Request/Curl.php b/framework/Http/lib/Horde/Http/Request/Curl.php index c13d7796f..8c4469b8a 100644 --- a/framework/Http/lib/Horde/Http/Request/Curl.php +++ b/framework/Http/lib/Horde/Http/Request/Curl.php @@ -36,9 +36,13 @@ class Horde_Http_Request_Curl extends Horde_Http_Request_Base $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $this->uri); curl_setopt($curl, CURLOPT_FILE, $body); - curl_setopt($curl, CURLOPT_POSTFIELDS, $this->data); curl_setopt($curl, CURLOPT_WRITEHEADER, $headers); + // If we don't set POSTFIELDS to a string, and the first value begins + // with @, it will be treated as a filename, and the proper POST data + // isn't passed. + curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($this->data)); + $result = curl_exec($curl); rewind($body);