-
Notifications
You must be signed in to change notification settings - Fork 148
Open
Description
When have a !
char (or maybe similar chars) in the cookies (Cookie: FOO=BAR!BAZ
), the chrome Copy as cURL(bash)
menu return be like this:
curl 'http://example.com/' \
-H $'Cookie: FOO=BAR\u0021BAZ' \
--compressed
When I use that in the https://incarnate.github.io/curl-to-php/ url, see:
// Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://example.com/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
$headers = array();
$headers[] = $_ENV["'Cookie": ';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);
You can see appears a syntax bug in $headers[] = $_ENV["'Cookie": ';...
Metadata
Metadata
Assignees
Labels
No labels