pollita Tue Dec 6 14:15:41 2005 EDT Modified files: (Branch: PHP_5_1) /php-src/ext/standard http_fopen_wrapper.c Log: MFH: (r-1.104) http://cvs.php.net/diff.php/php-src/ext/standard/http_fopen_wrapper.c?r1=1.99.2.3&r2=1.99.2.4&ty=u Index: php-src/ext/standard/http_fopen_wrapper.c diff -u php-src/ext/standard/http_fopen_wrapper.c:1.99.2.3 php-src/ext/standard/http_fopen_wrapper.c:1.99.2.4 --- php-src/ext/standard/http_fopen_wrapper.c:1.99.2.3 Tue Nov 15 09:46:34 2005 +++ php-src/ext/standard/http_fopen_wrapper.c Tue Dec 6 14:15:41 2005 @@ -19,7 +19,7 @@ | Sara Golemon <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: http_fopen_wrapper.c,v 1.99.2.3 2005/11/15 14:46:34 iliaa Exp $ */ +/* $Id: http_fopen_wrapper.c,v 1.99.2.4 2005/12/06 19:15:41 pollita Exp $ */ #include "php.h" #include "php_globals.h" @@ -305,7 +305,7 @@ 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 @@ } 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 @@ /* 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);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php