lbarnaud Thu May 28 13:20:23 2009 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/standard http_fopen_wrapper.c /php-src NEWS Log: MFH: merged http ignore_errors context option # [DOC] "since 5.2.10". See also bug #38802. http://cvs.php.net/viewvc.cgi/php-src/ext/standard/http_fopen_wrapper.c?r1=1.99.2.12.2.18&r2=1.99.2.12.2.19&diff_format=u Index: php-src/ext/standard/http_fopen_wrapper.c diff -u php-src/ext/standard/http_fopen_wrapper.c:1.99.2.12.2.18 php-src/ext/standard/http_fopen_wrapper.c:1.99.2.12.2.19 --- php-src/ext/standard/http_fopen_wrapper.c:1.99.2.12.2.18 Sun May 24 16:02:22 2009 +++ php-src/ext/standard/http_fopen_wrapper.c Thu May 28 13:20:22 2009 @@ -19,7 +19,7 @@ | Sara Golemon <poll...@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: http_fopen_wrapper.c,v 1.99.2.12.2.18 2009/05/24 16:02:22 iliaa Exp $ */ +/* $Id: http_fopen_wrapper.c,v 1.99.2.12.2.19 2009/05/28 13:20:22 lbarnaud Exp $ */ #include "php.h" #include "php_globals.h" @@ -104,7 +104,7 @@ size_t chunk_size = 0, file_size = 0; int eol_detect = 0; char *transport_string, *errstr = NULL; - int transport_len, have_header = 0, request_fulluri = 0; + int transport_len, have_header = 0, request_fulluri = 0, ignore_errors = 0; char *protocol_version = NULL; int protocol_version_len = 3; /* Default: "1.0" */ struct timeval timeout; @@ -552,9 +552,11 @@ } else { response_code = 0; } + if (context && SUCCESS==php_stream_context_get_option(context, "http", "ignore_errors", &tmpzval)) { + ignore_errors = zend_is_true(*tmpzval); + } /* when we request only the header, don't fail even on error codes */ - if ((options & STREAM_ONLY_GET_HEADERS) || - (context && php_stream_context_get_option(context, "http", "ignore_errors", &tmpzval) == SUCCESS && zend_is_true(*tmpzval)) ) { + if ((options & STREAM_ONLY_GET_HEADERS) || ignore_errors) { reqok = 1; } switch(response_code) { @@ -632,7 +634,7 @@ } if (!reqok || location[0] != '\0') { - if (options & STREAM_ONLY_GET_HEADERS && redirect_max <= 1) { + if (((options & STREAM_ONLY_GET_HEADERS) || ignore_errors) && redirect_max <= 1) { goto out; } http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1526&r2=1.2027.2.547.2.1527&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.1526 php-src/NEWS:1.2027.2.547.2.1527 --- php-src/NEWS:1.2027.2.547.2.1526 Wed May 27 13:51:15 2009 +++ php-src/NEWS Thu May 28 13:20:22 2009 @@ -12,6 +12,7 @@ - Added new CURL options CURLOPT_REDIR_PROTOCOLS, CURLOPT_PROTOCOLS, and CURLPROTO_* for redirect fixes in CURL 7.19.4. (Yoram Bar Haim, Stas) - Added support for Sun CC (FR #46595 and FR #46513). (David Soria Parra) +- Added "ignore_errors" option to http fopen wrapper. (David Zulke, Sara) - Fixed memory corruptions while reading properties of zip files. (Ilia) - Fixed memory leak in ob_get_clean/ob_get_flush. (Christian)
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php