From b83d45d714e97f65edb57597f15640406825273d Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Tue, 8 Sep 2009 21:51:53 -0400 Subject: [PATCH] Make sure we don't accidentally trigger curl's file uploading --- framework/Http/lib/Horde/Http/Request/Curl.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); -- 2.11.0