From f61b795a8f85149b43de471dbd4205689b29e938 Mon Sep 17 00:00:00 2001 From: Yasuo Ohgaki Date: Thu, 2 May 2002 01:58:12 +0000 Subject: [PATCH] Make Content-Type output always correct. # Flushing buffer is needed to be fixed properly anyway... --- main/main.c | 4 ++-- main/output.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/main/main.c b/main/main.c index 737507ac1d..fcd73d8239 100644 --- a/main/main.c +++ b/main/main.c @@ -295,7 +295,7 @@ PHP_INI_BEGIN() PHP_INI_ENTRY("disable_functions", "", PHP_INI_SYSTEM, NULL) STD_PHP_INI_ENTRY("allow_url_fopen", "1", PHP_INI_ALL, OnUpdateBool, allow_url_fopen, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("always_populate_raw_post_data", "0", PHP_INI_ALL, OnUpdateBool, always_populate_raw_post_data, php_core_globals, core_globals) + STD_PHP_INI_ENTRY("always_populate_raw_post_data", "0", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, always_populate_raw_post_data, php_core_globals, core_globals) PHP_INI_END() /* }}} */ @@ -739,7 +739,7 @@ int php_request_startup(TSRMLS_D) } else if (PG(output_buffering)) { if (PG(output_buffering)>1) { - php_start_ob_buffer(NULL, PG(output_buffering), 1 TSRMLS_CC); + php_start_ob_buffer(NULL, PG(output_buffering), 0 TSRMLS_CC); } else { php_start_ob_buffer(NULL, 0, 1 TSRMLS_CC); diff --git a/main/output.c b/main/output.c index 5b41bd8bdf..e8ffc9ee54 100644 --- a/main/output.c +++ b/main/output.c @@ -211,7 +211,8 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush TSRMLS if (SG(headers_sent) && !SG(request_info).headers_only) { OG(php_body_write) = php_ub_body_write_no_header; } else { - ADD_CL_HEADER(OG(active_ob_buffer).text_length); + if (!OG(active_ob_buffer).erase) /* Set Content-Length only if unerasable */ + ADD_CL_HEADER(OG(active_ob_buffer).text_length); OG(php_body_write) = php_ub_body_write; } } -- 2.40.0