From: Michael Wallner Date: Tue, 6 Jun 2006 21:38:28 +0000 (+0000) Subject: MFB: only try to fetch stream context options if context is set X-Git-Tag: RELEASE_1_0_0RC1~2770 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ebe449fde1437de084678f7c65febbcc45dc8311;p=php MFB: only try to fetch stream context options if context is set --- diff --git a/ext/curl/streams.c b/ext/curl/streams.c index d8889c1135..2941edf855 100644 --- a/ext/curl/streams.c +++ b/ext/curl/streams.c @@ -300,7 +300,7 @@ php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *filename, curl_easy_setopt(curlstream->curl, CURLOPT_USERAGENT, FG(user_agent) ? FG(user_agent) : "PHP/" PHP_VERSION); /* TODO: read cookies and options from context */ - if (!strncasecmp(filename, "http", sizeof("http")-1)) { + if (context && !strncasecmp(filename, "http", sizeof("http")-1)) { /* HTTP(S) */ if (SUCCESS == php_stream_context_get_option(context, "http", "user_agent", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_STRING) { curl_easy_setopt(curlstream->curl, CURLOPT_USERAGENT, Z_STRVAL_PP(ctx_opt));