From: dr_mantis at regad dot org Operating system: N/A PHP version: 5.4.14 Package: cURL related Bug Type: Feature/Change Request Bug description:Set default value for CURLOPT_USERAGENT
Description: ------------ When calling curl from command-line, unless specified otherwise it sets by default the User Agent to 'curl/x.y.z'. It would be nice if the php curl extension did the same thing (at the moment, the user agent is set to blank), to avoid having to do something like $v = curl_version(); curl_setopt( $curl, CURLOPT_USERAGENT, 'curl/' . $v['version'] ); Test script: --------------- $ curl localhost ==> access.log ::1 - - [26/Apr/2013:16:54:52 +0200] "GET / HTTP/1.1" 200 1665 "-" "curl/7.27.0" $ php -a php > $c = curl_init('localhost'); php > curl_exec($c); ==> access.log ::1 - - [26/Apr/2013:16:53:15 +0200] "GET / HTTP/1.1" 200 1665 "-" "-" -- Edit bug report at https://bugs.php.net/bug.php?id=64723&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64723&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64723&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64723&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=64723&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=64723&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=64723&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=64723&r=needscript Try newer version: https://bugs.php.net/fix.php?id=64723&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=64723&r=support Expected behavior: https://bugs.php.net/fix.php?id=64723&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=64723&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=64723&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=64723&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64723&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=64723&r=dst IIS Stability: https://bugs.php.net/fix.php?id=64723&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=64723&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=64723&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=64723&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=64723&r=mysqlcfg