Index: ext/standard/http_fopen_wrapper.c =================================================================== RCS file: /repository/php-src/ext/standard/http_fopen_wrapper.c,v retrieving revision 1.99.2.6 diff -u -p -d -r1.99.2.6 http_fopen_wrapper.c --- ext/standard/http_fopen_wrapper.c 9 Dec 2005 18:53:09 -0000 1.99.2.6 +++ ext/standard/http_fopen_wrapper.c 11 Dec 2005 22:19:33 -0000 @@ -461,11 +461,13 @@ php_stream *php_stream_url_wrap_http_ex( location[0] = '\0'; - if (!header_init) { - MAKE_STD_ZVAL(stream->wrapperdata); - array_init(stream->wrapperdata); - response_header = &stream->wrapperdata; - } else { + + if (!header_init && FAILURE == zend_hash_find(EG(active_symbol_table), + "http_response_header", sizeof("http_response_header"), (void **) &response_header)) { + header_init = 1; + } + + if (header_init) { zval *tmp; MAKE_STD_ZVAL(tmp); array_init(tmp); @@ -641,7 +643,7 @@ php_stream *php_stream_url_wrap_http_ex( CHECK_FOR_CNTRL_CHARS(resource->path) stream = php_stream_url_wrap_http_ex(wrapper, new_path, mode, options, opened_path, context, --redirect_max, 0 STREAMS_CC TSRMLS_CC); - if (stream && stream->wrapperdata && *response_header != stream->wrapperdata) { + if (stream && stream->wrapperdata) { entryp = &entry; MAKE_STD_ZVAL(entry); ZVAL_EMPTY_STRING(entry);