summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasuo Ohgaki <yohgaki@php.net>2002-05-02 01:58:12 +0000
committerYasuo Ohgaki <yohgaki@php.net>2002-05-02 01:58:12 +0000
commitf61b795a8f85149b43de471dbd4205689b29e938 (patch)
treeae86cb9dbc2b355b3e258913c2503978a81d9f85
parentcbf8a26d53d5c1f1f1202195826e639852949ba4 (diff)
downloadphp-git-f61b795a8f85149b43de471dbd4205689b29e938.tar.gz
Make Content-Type output always correct.
# Flushing buffer is needed to be fixed properly anyway...
-rw-r--r--main/main.c4
-rw-r--r--main/output.c3
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;
}
}