]> granicus.if.org Git - php/commitdiff
MFH: Use user_agent ini setting if it's available.
authorSara Golemon <pollita@php.net>
Tue, 31 Aug 2004 20:12:56 +0000 (20:12 +0000)
committerSara Golemon <pollita@php.net>
Tue, 31 Aug 2004 20:12:56 +0000 (20:12 +0000)
ext/curl/curlstreams.c

index 97b9d20d0a24aeff7fa7a6b69d5d5386e47911a1..a6c682c4ece42d0437baf85acf67dd08efb6995f 100644 (file)
@@ -307,7 +307,7 @@ PHPAPI php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *fil
        curl_easy_setopt(curlstream->curl, CURLOPT_PROGRESSDATA, stream);
        curl_easy_setopt(curlstream->curl, CURLOPT_NOPROGRESS, 0);
 
-       curl_easy_setopt(curlstream->curl, CURLOPT_USERAGENT, "PHP/" PHP_VERSION);
+       curl_easy_setopt(curlstream->curl, CURLOPT_USERAGENT, FG(user_agent) ? FG(user_agent) : "PHP/" PHP_VERSION);
        
        /* TODO: read cookies and options from context */