]> granicus.if.org Git - php/commitdiff
Allow http fopen wrapper to fetch content on 'error' condition (David Zulke)
authorSara Golemon <pollita@php.net>
Mon, 5 Nov 2007 00:47:21 +0000 (00:47 +0000)
committerSara Golemon <pollita@php.net>
Mon, 5 Nov 2007 00:47:21 +0000 (00:47 +0000)
ext/standard/http_fopen_wrapper.c

index fa7bc97fa3b6f5d0bec43bdd83cb1e9d996c2205..849eb99ebfb560ab0ef824b32c003087c6ae11f7 100644 (file)
@@ -544,7 +544,8 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
                                response_code = 0;
                        }
                        /* when we request only the header, don't fail even on error codes */
-                       if (options & STREAM_ONLY_GET_HEADERS) {
+                       if ((options & STREAM_ONLY_GET_HEADERS) ||
+                               (php_stream_context_get_option(context, "http", "ignore_errors",  &tmpzval) == SUCCESS && zend_is_true(*tmpzval)) ) {
                                reqok = 1;
                        }
                        switch(response_code) {