From d6212d96f44c548430cdc0fdf92735c67c0d8b6c Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Tue, 6 Jun 2006 21:38:03 +0000 Subject: [PATCH] - only try to fetch stream context options if context is set --- ext/curl/streams.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); -- 2.40.0