summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/basic_functions.c2
-rw-r--r--ext/standard/var.c10
-rw-r--r--main/output.c8
3 files changed, 13 insertions, 7 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index f52932c9d3..afe4eb9dfc 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -2077,6 +2077,7 @@ PHP_FUNCTION(highlight_string)
convert_to_string(expr);
if (i) {
+ php_output_set_status(0 TSRMLS_CC);
php_start_ob_buffer (NULL, 0, 1 TSRMLS_CC);
}
@@ -2093,6 +2094,7 @@ PHP_FUNCTION(highlight_string)
if (i) {
php_ob_get_buffer (return_value TSRMLS_CC);
php_end_ob_buffer (0, 0 TSRMLS_CC);
+ php_output_set_status(1 TSRMLS_CC);
} else {
RETURN_TRUE;
}
diff --git a/ext/standard/var.c b/ext/standard/var.c
index 2f4e4c5b3c..0f3c70bdb3 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -342,21 +342,23 @@ void php_var_export(zval **struc, int level TSRMLS_DC)
PHP_FUNCTION(var_export)
{
zval *var;
- zend_bool i = 0;
+ zend_bool return_output = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &var, &i) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &var, &return_output) == FAILURE) {
return;
}
- if (i) {
+ if (return_output) {
+ php_output_set_status(0 TSRMLS_CC);
php_start_ob_buffer (NULL, 0, 1 TSRMLS_CC);
}
php_var_export(&var, 1 TSRMLS_CC);
- if (i) {
+ if (return_output) {
php_ob_get_buffer (return_value TSRMLS_CC);
php_end_ob_buffer (0, 0 TSRMLS_CC);
+ php_output_set_status(1 TSRMLS_CC);
}
}
/* }}} */
diff --git a/main/output.c b/main/output.c
index 39ff8d8c19..a644ba75df 100644
--- a/main/output.c
+++ b/main/output.c
@@ -591,10 +591,12 @@ static inline void php_ob_append(const char *text, uint text_length TSRMLS_DC)
memcpy(target, text, text_length);
target[text_length]=0;
- if (OG(active_ob_buffer).chunk_size
- && OG(active_ob_buffer).text_length >= OG(active_ob_buffer).chunk_size) {
+ /* If implicit_flush is On, send contents to next buffer and return. */
+ if (OG(implicit_flush) || OG(active_ob_buffer).chunk_size
+ && OG(active_ob_buffer).text_length >= OG(active_ob_buffer).chunk_size)
+ {
zval *output_handler = OG(active_ob_buffer).output_handler;
-
+
if (output_handler) {
output_handler->refcount++;
}