diff options
author | Michael Wallner <mike@php.net> | 2006-06-06 21:38:03 +0000 |
---|---|---|
committer | Michael Wallner <mike@php.net> | 2006-06-06 21:38:03 +0000 |
commit | d6212d96f44c548430cdc0fdf92735c67c0d8b6c (patch) | |
tree | 4b85136b73bc09065968ad9c0c1b033ecfcb19ba | |
parent | 928c20942bb17213893acf12f9ff5b8567d42400 (diff) | |
download | php-git-d6212d96f44c548430cdc0fdf92735c67c0d8b6c.tar.gz |
- only try to fetch stream context options if context is set
-rw-r--r-- | ext/curl/streams.c | 2 |
1 files changed, 1 insertions, 1 deletions
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)); |