|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-12-15 09:19 UTC] aharvey@php.net
-Status: Open
+Status: Bogus
[2010-12-15 09:19 UTC] aharvey@php.net
[2010-12-15 09:29 UTC] wangyi6854 at sohu dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 17:00:02 2025 UTC |
Description: ------------ curl post will failed when post field's first char is '@'. the ip address in the following code is www.example.com's. You can replace it with any address. Test script: --------------- <?php $msg = ''; if ( !empty( $_POST ) ) { $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, "http://192.0.32.10/" ); curl_setopt( $ch, CURLOPT_POST, 1 ); curl_setopt( $ch, CURLOPT_POSTFIELDS, array( 'test' => '@aaaa' ) ); if ( false === curl_exec( $ch ) ) { $msg .= 'curl error: ' . curl_errno( $ch ) . ".\nmessage: " . curl_error( $ch ) . PHP_EOL; } else { $msg .= 'OK!'; } curl_close( $ch ); } ?> <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head></head> <body> <pre><?php echo $msg; ?></pre> <form method="post" action=""> <input type="submit" name="test" value="test!" /> </form> </body></html> Expected result: ---------------- curl should work whatever the content is. Actual result: -------------- curl will failed when post field's first char is '@'.