yohgaki         Thu Oct  3 09:32:02 2002 EDT

  Modified files:              
    /php4/ext/standard  basic_functions.c var.c 
    /php4/main  output.c 
  Log:
  Fixed broken code by Derick. 
  ob_implicit_flush() and ob_flush_all() are stopped working.
  var_dump() and hightlisht_string() outputs buffer contents wrongly
  with ob_implicit_flush().
  
  Everyone should be happy now.
  It was only OG(implicit_flush) interpretation issue after all. 
  
  
  
Index: php4/ext/standard/basic_functions.c
diff -u php4/ext/standard/basic_functions.c:1.521 
php4/ext/standard/basic_functions.c:1.522
--- php4/ext/standard/basic_functions.c:1.521   Thu Oct  3 06:42:57 2002
+++ php4/ext/standard/basic_functions.c Thu Oct  3 09:31:59 2002
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: basic_functions.c,v 1.521 2002/10/03 10:42:57 andrey Exp $ */
+/* $Id: basic_functions.c,v 1.522 2002/10/03 13:31:59 yohgaki Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -2077,6 +2077,7 @@
        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 @@
        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;
        }
Index: php4/ext/standard/var.c
diff -u php4/ext/standard/var.c:1.147 php4/ext/standard/var.c:1.148
--- php4/ext/standard/var.c:1.147       Thu Oct  3 06:35:33 2002
+++ php4/ext/standard/var.c     Thu Oct  3 09:32:00 2002
@@ -342,21 +342,23 @@
 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);
        }
 }
 /* }}} */
Index: php4/main/output.c
diff -u php4/main/output.c:1.137 php4/main/output.c:1.138
--- php4/main/output.c:1.137    Thu Oct  3 07:56:10 2002
+++ php4/main/output.c  Thu Oct  3 09:32:01 2002
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: output.c,v 1.137 2002/10/03 11:56:10 jmoore Exp $ */
+/* $Id: output.c,v 1.138 2002/10/03 13:32:01 yohgaki Exp $ */
 
 #include "php.h"
 #include "ext/standard/head.h"
@@ -591,10 +591,12 @@
        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++;
                }



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to