diff options
author | Sara Golemon <pollita@php.net> | 2005-12-06 19:15:41 +0000 |
---|---|---|
committer | Sara Golemon <pollita@php.net> | 2005-12-06 19:15:41 +0000 |
commit | 2b059ae91f312de1ec61b8928e25d33051ae36c5 (patch) | |
tree | e4e2d049633ace1b1996e0ce888fd0235c33a1c6 | |
parent | dfba12435dd3915164304ce6ebdc7a98e8e5c227 (diff) | |
download | php-git-2b059ae91f312de1ec61b8928e25d33051ae36c5.tar.gz |
MFH: (r-1.104)
-rw-r--r-- | ext/standard/http_fopen_wrapper.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index 96ba403494..4c2321f486 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -305,7 +305,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path, if (context && php_stream_context_get_option(context, "http", "header", &tmpzval) == SUCCESS && - Z_STRLEN_PP(tmpzval)) { + Z_TYPE_PP(tmpzval) == IS_STRING && Z_STRLEN_PP(tmpzval)) { /* Remove newlines and spaces from start and end, php_trim will estrndup() */ tmp = php_trim(Z_STRVAL_PP(tmpzval), Z_STRLEN_PP(tmpzval), NULL, 0, NULL, 3 TSRMLS_CC); @@ -409,7 +409,8 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path, } if (context && - php_stream_context_get_option(context, "http", "user_agent", &ua_zval) == SUCCESS) { + php_stream_context_get_option(context, "http", "user_agent", &ua_zval) == SUCCESS && + Z_TYPE_PP(ua_zval) == IS_STRING) { ua_str = Z_STRVAL_PP(ua_zval); } else if (FG(user_agent)) { ua_str = FG(user_agent); @@ -441,7 +442,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path, /* Request content, such as for POST requests */ if (header_init && context && php_stream_context_get_option(context, "http", "content", &tmpzval) == SUCCESS && - Z_STRLEN_PP(tmpzval) > 0) { + Z_TYPE_PP(tmpzval) == IS_STRING && Z_STRLEN_PP(tmpzval) > 0) { if (!(have_header & HTTP_HEADER_CONTENT_LENGTH)) { scratch_len = snprintf(scratch, scratch_len, "Content-Length: %d\r\n", Z_STRLEN_PP(tmpzval)); php_stream_write(stream, scratch, scratch_len); |