lbarnaud                Sat May 16 20:34:49 2009 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/standard       http_fopen_wrapper.c 
    /php-src    NEWS 
  Log:
  Fixed bug #38802 (max_redirects and ignore_errors)
  (patch by datib...@php.net)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/http_fopen_wrapper.c?r1=1.99.2.12.2.9.2.16&r2=1.99.2.12.2.9.2.17&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.9.2.16 
php-src/ext/standard/http_fopen_wrapper.c:1.99.2.12.2.9.2.17
--- php-src/ext/standard/http_fopen_wrapper.c:1.99.2.12.2.9.2.16        Thu May 
14 13:36:56 2009
+++ php-src/ext/standard/http_fopen_wrapper.c   Sat May 16 20:34:48 2009
@@ -19,7 +19,7 @@
    |          Sara Golemon <poll...@php.net>                              |
    +----------------------------------------------------------------------+
  */
-/* $Id: http_fopen_wrapper.c,v 1.99.2.12.2.9.2.16 2009/05/14 13:36:56 cellog 
Exp $ */ 
+/* $Id: http_fopen_wrapper.c,v 1.99.2.12.2.9.2.17 2009/05/16 20:34:48 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;
@@ -557,9 +557,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;
                        }
                        /* all status codes in the 2xx range are defined by the 
specification as successful;
@@ -656,7 +658,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.965.2.604&r2=1.2027.2.547.2.965.2.605&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.604 
php-src/NEWS:1.2027.2.547.2.965.2.605
--- php-src/NEWS:1.2027.2.547.2.965.2.604       Thu May 14 22:03:35 2009
+++ php-src/NEWS        Sat May 16 20:34:48 2009
@@ -14,6 +14,8 @@
   --enable-zend-multibyte is used). (Jani)
 - Fixed bug #48188 (Cannot execute a scrollable cursors twice with
   PDO_PGSQL). (Matteo)
+- Fixed bug #38802 (max_redirects and ignore_errors).
+  (patch by datib...@php.net)
 
 
 07 May 2009, PHP 5.3.0 RC 2



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to