}
/* useragent, default "PECL::HTTP/version (PHP/version)" */
- if ((zoption = http_request_option(request, options, "useragent", IS_STRING)) && Z_STRLEN_P(zoption)) {
- HTTP_CURL_OPT(USERAGENT, Z_STRVAL_P(zoption));
+ if ((zoption = http_request_option(request, options, "useragent", IS_STRING))) {
+ if (Z_STRLEN_P(zoption)) {
+ HTTP_CURL_OPT(USERAGENT, Z_STRVAL_P(zoption));
+ } else {
+ HTTP_CURL_OPT(USERAGENT, NULL);
+ }
}
/* additional headers, array('name' => 'value') */