note 74814 deleted from ref.curl by felipe
| From: | felipe@php.net | Date: | Sun, 30 Mar 2008 19:05:04 +0000 |
| Subject: | note 74814 deleted from ref.curl by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-137767@lists.php.net to get a copy of this message | ||
Note Submitter: Frank DENIS
----
There's a serious bug with CURLOPT_POSTFIELDS and multipart data :
<?php
$data = array('text' => "@pouetpouet");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://127.0.0.1:9999');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_exec($ch);
?>
You can grab the output with something like "nc -l -p 9999" (Linux) or "nl -l
9999" (OpenBSD).
If the text begins with a @ (@pouetpouet), nothing is sent. If the text doesn't begin with @,
the request is properly sent.
Another issue is that there's a slight delay between the header and the first block of
multipart data.