Skip to content

Commit 1731767

Browse files
author
Yasuo Ohgaki
committed
Prevent unwanted fluhsing.
1 parent 6c7202e commit 1731767

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ext/standard/var.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,21 +342,23 @@ void php_var_export(zval **struc, int level TSRMLS_DC)
342342
PHP_FUNCTION(var_export)
343343
{
344344
zval *var;
345-
zend_bool i = 0;
345+
zend_bool return_output = 0;
346346

347-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &var, &i) == FAILURE) {
347+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &var, &return_output) == FAILURE) {
348348
return;
349349
}
350350

351-
if (i) {
351+
if (return_output) {
352+
php_output_set_status(0 TSRMLS_CC);
352353
php_start_ob_buffer (NULL, 0, 1 TSRMLS_CC);
353354
}
354355

355356
php_var_export(&var, 1 TSRMLS_CC);
356357

357-
if (i) {
358+
if (return_output) {
358359
php_ob_get_buffer (return_value TSRMLS_CC);
359360
php_end_ob_buffer (0, 0 TSRMLS_CC);
361+
php_output_set_status(1 TSRMLS_CC);
360362
}
361363
}
362364
/* }}} */

0 commit comments

Comments
 (0)