note 74814 added to ref.curl
| From: | FrankDENIS at osu1 dot php dot net | Date: | Sat, 28 Apr 2007 09:41:38 +0000 |
| Subject: | note 74814 added to ref.curl | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-125949@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 217.174.196.197
Probable Submitter: 82.224.188.215
----
Manual Page -- http://www.php.net/manual/en/ref.curl.php
Edit -- https://master.php.net/note/edit/74814
Del: integrated -- https://master.php.net/note/delete/74814/integrated
Del: useless -- https://master.php.net/note/delete/74814/useless
Del: bad code -- https://master.php.net/note/delete/74814/bad+code
Del: spam -- https://master.php.net/note/delete/74814/spam
Del: non-english -- https://master.php.net/note/delete/74814/non-english
Del: in docs -- https://master.php.net/note/delete/74814/in+docs
Del: other reasons-- https://master.php.net/note/delete/74814
Reject -- https://master.php.net/note/reject/74814
Search -- https://master.php.net/manage/user-notes.php