]> 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:11:32 +0000 (20:11 +0000)
committerSara Golemon <pollita@php.net>
Tue, 31 Aug 2004 20:11:32 +0000 (20:11 +0000)
ext/curl/streams.c

index 4e709e9485cce8f7336da181c5b1425222e639f0..2c127e3fdb184273c13b5802ffb8d3ac0e03e85e 100644 (file)
@@ -299,7 +299,7 @@ php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *filename,
        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 */