]> granicus.if.org Git - php/commitdiff
Made ob_start() and friends reentrant. It's now possible to implement this
authorZeev Suraski <zeev@php.net>
Sat, 29 Jul 2000 14:46:09 +0000 (14:46 +0000)
committerZeev Suraski <zeev@php.net>
Sat, 29 Jul 2000 14:46:09 +0000 (14:46 +0000)
long-requested functionality, now that output buffering is re-entrant:

function eval_ret($code)
{
ob_start();
eval($code);
$retval = ob_get_contents();
ob_end_clean();
return $retval;
}

NEWS
ext/standard/output.c
ext/standard/php_output.h
main/main.c
main/output.c
main/php_output.h
sapi/apache/php_apache.c
sapi/apache/sapi_apache.c
sapi/cgi/cgi_main.c

diff --git a/NEWS b/NEWS
index ad3034b35c25638827cbe835dda63e7b50fad3cb..0c794332cc3df555727ff25212da99ea5c23ee17 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ PHP 4.0                                                                    NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 
 ?? ??? 2000, Version 4.0.2
+- Improved the output-buffering functions to be re-entrant (Zeev)
 - Made ldap_add(), ldap_modify(), ldap_mod_add(), ldap_mod_replace()
   binary-safe. Original patch: Terrence Miao <terrence_miao@email.com> (Jani)
 - CGI aka. command line version has now an option '-l' for syntax check
index ca156491eea785cd2118d0d8b60f208a016bff4b..2b3fb8efe7c90dc265b73ba555fca7bb0b8f9d1e 100644 (file)
@@ -48,10 +48,6 @@ static void php_output_init_globals(OLS_D)
 {
        OG(php_body_write) = NULL;
        OG(php_header_write) = NULL;
-       OG(ob_buffer) = NULL;
-       OG(ob_size) = 0;
-       OG(ob_block_size) = 0;
-       OG(ob_text_length) = 0;
        OG(implicit_flush) = 0;
        OG(output_start_filename) = NULL;
        OG(output_start_lineno) = 0;
@@ -74,9 +70,9 @@ PHPAPI void php_output_startup()
 {
        OLS_FETCH();
 
-       OG(ob_buffer) = NULL;
        OG(php_body_write) = php_ub_body_write;
        OG(php_header_write) = sapi_module.ub_write;
+       OG(nesting_level) = 0;
 }
 
 PHPAPI int php_body_write(const char *str, uint str_length)
@@ -92,7 +88,7 @@ PHPAPI int php_header_write(const char *str, uint str_length)
 }
 
 /* Start output buffering */
-PHPAPI void php_start_ob_buffering()
+PHPAPI void php_start_ob_buffer()
 {
        OLS_FETCH();
 
@@ -101,32 +97,49 @@ PHPAPI void php_start_ob_buffering()
 }
 
 
-/* End output buffering */
-PHPAPI void php_end_ob_buffering(int send_buffer)
+/* End output buffering (one level) */
+PHPAPI void php_end_ob_buffer(int send_buffer)
 {
        SLS_FETCH();
        OLS_FETCH();
 
-       if (!OG(ob_buffer)) {
+       if (OG(nesting_level)==0) {
                return;
        }
-       if (SG(headers_sent) && !SG(request_info).headers_only) {
-               OG(php_body_write) = php_ub_body_write_no_header;
-       } else {
-               OG(php_body_write) = php_ub_body_write;
-       }
-       if (send_buffer) {
-               php_ob_send();
+       if (OG(nesting_level)==1) { /* end buffering */
+               if (SG(headers_sent) && !SG(request_info).headers_only) {
+                       OG(php_body_write) = php_ub_body_write_no_header;
+               } else {
+                       OG(php_body_write) = php_ub_body_write;
+               }
+               if (send_buffer) {
+                       php_ob_send();
+               }
+       } else { /* only flush the buffer, if necessary */
+               if (send_buffer) {
+                       OG(php_body_write)(OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length);
+               }
        }
        php_ob_destroy();
 }
 
 
+/* End output buffering (all buffers) */
+PHPAPI void php_end_ob_buffers(int send_buffer)
+{
+       OLS_FETCH();
+
+       while (OG(nesting_level)!=0) {
+               php_end_ob_buffer(send_buffer);
+       }
+}
+
+
 PHPAPI void php_start_implicit_flush()
 {
        OLS_FETCH();
 
-       php_end_ob_buffering(1);                /* Switch out of output buffering if we're in it */
+       php_end_ob_buffer(1);           /* Switch out of output buffering if we're in it */
        OG(implicit_flush)=1;
 }
 
@@ -147,11 +160,12 @@ static inline void php_ob_allocate(void)
 {
        OLS_FETCH();
 
-       if (OG(ob_size)<OG(ob_text_length)) {
-               while (OG(ob_size) <= OG(ob_text_length))
-                       OG(ob_size)+=OG(ob_block_size);
+       if (OG(active_ob_buffer).size<OG(active_ob_buffer).text_length) {
+               while (OG(active_ob_buffer).size <= OG(active_ob_buffer).text_length) {
+                       OG(active_ob_buffer).size+=OG(active_ob_buffer).block_size;
+               }
                        
-               OG(ob_buffer) = (char *) erealloc(OG(ob_buffer), OG(ob_size)+1);
+               OG(active_ob_buffer).buffer = (char *) erealloc(OG(active_ob_buffer).buffer, OG(active_ob_buffer).size+1);
        }
 }
 
@@ -160,13 +174,17 @@ static void php_ob_init(uint initial_size, uint block_size)
 {
        OLS_FETCH();
 
-       if (OG(ob_buffer)) {
-               return;
+       if (OG(nesting_level)>0) {
+               if (OG(nesting_level)==1) { /* initialize stack */
+                       zend_stack_init(&OG(ob_buffers));
+               }
+               zend_stack_push(&OG(ob_buffers), &OG(active_ob_buffer), sizeof(php_ob_buffer));
        }
-       OG(ob_block_size) = block_size;
-       OG(ob_size) = initial_size;
-       OG(ob_buffer) = (char *) emalloc(initial_size+1);
-       OG(ob_text_length) = 0;
+       OG(nesting_level)++;
+       OG(active_ob_buffer).block_size = block_size;
+       OG(active_ob_buffer).size = initial_size;
+       OG(active_ob_buffer).buffer = (char *) emalloc(initial_size+1);
+       OG(active_ob_buffer).text_length = 0;
 }
 
 
@@ -174,10 +192,20 @@ static void php_ob_destroy()
 {
        OLS_FETCH();
 
-       if (OG(ob_buffer)) {
-               efree(OG(ob_buffer));
-               OG(ob_buffer) = NULL;
+       if (OG(nesting_level)>0) {
+               efree(OG(active_ob_buffer).buffer);
+               if (OG(nesting_level)>1) { /* restore previous buffer */
+                       php_ob_buffer *ob_buffer_p;
+
+                       zend_stack_top(&OG(ob_buffers), (void **) &ob_buffer_p);
+                       OG(active_ob_buffer) = *ob_buffer_p;
+                       zend_stack_del_top(&OG(ob_buffers));
+                       if (OG(nesting_level)==2) { /* destroy the stack */
+                               zend_stack_destroy(&OG(ob_buffers));
+                       }
+               } 
        }
+       OG(nesting_level)--;
 }
 
 
@@ -187,11 +215,11 @@ static void php_ob_append(const char *text, uint text_length)
        int original_ob_text_length;
        OLS_FETCH();
 
-       original_ob_text_length=OG(ob_text_length);
+       original_ob_text_length=OG(active_ob_buffer).text_length;
 
-       OG(ob_text_length) += text_length;
+       OG(active_ob_buffer).text_length += text_length;
        php_ob_allocate();
-       target = OG(ob_buffer)+original_ob_text_length;
+       target = OG(active_ob_buffer).buffer+original_ob_text_length;
        memcpy(target, text, text_length);
        target[text_length]=0;
 }
@@ -202,7 +230,7 @@ static void php_ob_prepend(const char *text, uint text_length)
        char *p, *start;
        OLS_FETCH();
 
-       OG(ob_text_length) += text_length;
+       OG(active_ob_buffer).text_length += text_length;
        php_ob_allocate();
 
        /* php_ob_allocate() may change OG(ob_buffer), so we can't initialize p&start earlier */
@@ -213,7 +241,7 @@ static void php_ob_prepend(const char *text, uint text_length)
                p[text_length] = *p;
        }
        memcpy(OG(ob_buffer), text, text_length);
-       OG(ob_buffer)[OG(ob_text_length)]=0;
+       OG(ob_buffer)[OG(active_ob_buffer).text_length]=0;
 }
 #endif
 
@@ -222,7 +250,7 @@ static inline void php_ob_send()
        OLS_FETCH();
 
        /* header_write is a simple, unbuffered output function */
-       OG(php_body_write)(OG(ob_buffer), OG(ob_text_length));
+       OG(php_body_write)(OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length);
 }
 
 
@@ -231,12 +259,12 @@ int php_ob_get_buffer(pval *p)
 {
        OLS_FETCH();
 
-       if (!OG(ob_buffer)) {
+       if (OG(nesting_level)==0) {
                return FAILURE;
        }
        p->type = IS_STRING;
-       p->value.str.val = estrndup(OG(ob_buffer), OG(ob_text_length));
-       p->value.str.len = OG(ob_text_length);
+       p->value.str.val = estrndup(OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length);
+       p->value.str.len = OG(active_ob_buffer).text_length;
        return SUCCESS;
 }
 
@@ -321,7 +349,7 @@ static int php_ub_body_write(const char *str, uint str_length)
    Turn on Output Buffering */
 PHP_FUNCTION(ob_start)
 {
-       php_start_ob_buffering();
+       php_start_ob_buffer();
 }
 /* }}} */
 
@@ -330,7 +358,7 @@ PHP_FUNCTION(ob_start)
    Flush (send) the output buffer, and turn off output buffering */
 PHP_FUNCTION(ob_end_flush)
 {
-       php_end_ob_buffering(1);
+       php_end_ob_buffer(1);
 }
 /* }}} */
 
@@ -339,7 +367,7 @@ PHP_FUNCTION(ob_end_flush)
    Clean (erase) the output buffer, and turn off output buffering */
 PHP_FUNCTION(ob_end_clean)
 {
-       php_end_ob_buffering(0);
+       php_end_ob_buffer(0);
 }
 /* }}} */
 
index 022715a056b2f2df59b39ec94a4fa42d71f88021..966d6dbe3508f09ab08c27ab95c244517d1d942a 100644 (file)
@@ -26,8 +26,9 @@
 PHPAPI void php_output_startup(void);
 PHPAPI int  php_body_write(const char *str, uint str_length);
 PHPAPI int  php_header_write(const char *str, uint str_length);
-PHPAPI void php_start_ob_buffering(void);
-PHPAPI void php_end_ob_buffering(int send_buffer);
+PHPAPI void php_start_ob_buffer(void);
+PHPAPI void php_end_ob_buffer(int send_buffer);
+PHPAPI void php_end_ob_buffers(int send_buffer);
 PHPAPI int php_ob_get_buffer(pval *p);
 PHPAPI void php_start_implicit_flush(void);
 PHPAPI void php_end_implicit_flush(void);
@@ -42,16 +43,22 @@ PHP_FUNCTION(ob_implicit_flush);
 
 PHP_GINIT_FUNCTION(output);
 
-typedef struct {
+typedef struct _php_ob_buffer {
+       char *buffer;
+       uint size;
+       uint text_length;
+       int block_size;
+} php_ob_buffer;
+
+typedef struct _php_output_globals {
        int (*php_body_write)(const char *str, uint str_length);                /* string output */
        int (*php_header_write)(const char *str, uint str_length);      /* unbuffer string output */
-       char *ob_buffer;
-       uint ob_size;
-       uint ob_block_size;
-       uint ob_text_length;
+       php_ob_buffer active_ob_buffer;
        unsigned char implicit_flush;
        char *output_start_filename;
        int output_start_lineno;
+       zend_stack ob_buffers;
+       int nesting_level;
 } php_output_globals;
 
 
index 927fd77200c1e9e750e6f5e900138733533fc28c..e2ad88337bea65c8e022819833d66bc17c98b4a1 100644 (file)
@@ -630,7 +630,7 @@ int php_request_startup(CLS_D ELS_DC PLS_DC SLS_DC)
        }
 
        if (PG(output_buffering)) {
-               php_start_ob_buffering();
+               php_start_ob_buffer();
        } else if (PG(implicit_flush)) {
                php_start_implicit_flush();
        }
@@ -659,7 +659,7 @@ void php_request_shutdown(void *dummy)
        }
 
        sapi_send_headers();
-       php_end_ob_buffering(SG(request_info).headers_only?0:1);
+       php_end_ob_buffers(SG(request_info).headers_only?0:1);
 
        php_call_shutdown_functions();
        
index ca156491eea785cd2118d0d8b60f208a016bff4b..2b3fb8efe7c90dc265b73ba555fca7bb0b8f9d1e 100644 (file)
@@ -48,10 +48,6 @@ static void php_output_init_globals(OLS_D)
 {
        OG(php_body_write) = NULL;
        OG(php_header_write) = NULL;
-       OG(ob_buffer) = NULL;
-       OG(ob_size) = 0;
-       OG(ob_block_size) = 0;
-       OG(ob_text_length) = 0;
        OG(implicit_flush) = 0;
        OG(output_start_filename) = NULL;
        OG(output_start_lineno) = 0;
@@ -74,9 +70,9 @@ PHPAPI void php_output_startup()
 {
        OLS_FETCH();
 
-       OG(ob_buffer) = NULL;
        OG(php_body_write) = php_ub_body_write;
        OG(php_header_write) = sapi_module.ub_write;
+       OG(nesting_level) = 0;
 }
 
 PHPAPI int php_body_write(const char *str, uint str_length)
@@ -92,7 +88,7 @@ PHPAPI int php_header_write(const char *str, uint str_length)
 }
 
 /* Start output buffering */
-PHPAPI void php_start_ob_buffering()
+PHPAPI void php_start_ob_buffer()
 {
        OLS_FETCH();
 
@@ -101,32 +97,49 @@ PHPAPI void php_start_ob_buffering()
 }
 
 
-/* End output buffering */
-PHPAPI void php_end_ob_buffering(int send_buffer)
+/* End output buffering (one level) */
+PHPAPI void php_end_ob_buffer(int send_buffer)
 {
        SLS_FETCH();
        OLS_FETCH();
 
-       if (!OG(ob_buffer)) {
+       if (OG(nesting_level)==0) {
                return;
        }
-       if (SG(headers_sent) && !SG(request_info).headers_only) {
-               OG(php_body_write) = php_ub_body_write_no_header;
-       } else {
-               OG(php_body_write) = php_ub_body_write;
-       }
-       if (send_buffer) {
-               php_ob_send();
+       if (OG(nesting_level)==1) { /* end buffering */
+               if (SG(headers_sent) && !SG(request_info).headers_only) {
+                       OG(php_body_write) = php_ub_body_write_no_header;
+               } else {
+                       OG(php_body_write) = php_ub_body_write;
+               }
+               if (send_buffer) {
+                       php_ob_send();
+               }
+       } else { /* only flush the buffer, if necessary */
+               if (send_buffer) {
+                       OG(php_body_write)(OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length);
+               }
        }
        php_ob_destroy();
 }
 
 
+/* End output buffering (all buffers) */
+PHPAPI void php_end_ob_buffers(int send_buffer)
+{
+       OLS_FETCH();
+
+       while (OG(nesting_level)!=0) {
+               php_end_ob_buffer(send_buffer);
+       }
+}
+
+
 PHPAPI void php_start_implicit_flush()
 {
        OLS_FETCH();
 
-       php_end_ob_buffering(1);                /* Switch out of output buffering if we're in it */
+       php_end_ob_buffer(1);           /* Switch out of output buffering if we're in it */
        OG(implicit_flush)=1;
 }
 
@@ -147,11 +160,12 @@ static inline void php_ob_allocate(void)
 {
        OLS_FETCH();
 
-       if (OG(ob_size)<OG(ob_text_length)) {
-               while (OG(ob_size) <= OG(ob_text_length))
-                       OG(ob_size)+=OG(ob_block_size);
+       if (OG(active_ob_buffer).size<OG(active_ob_buffer).text_length) {
+               while (OG(active_ob_buffer).size <= OG(active_ob_buffer).text_length) {
+                       OG(active_ob_buffer).size+=OG(active_ob_buffer).block_size;
+               }
                        
-               OG(ob_buffer) = (char *) erealloc(OG(ob_buffer), OG(ob_size)+1);
+               OG(active_ob_buffer).buffer = (char *) erealloc(OG(active_ob_buffer).buffer, OG(active_ob_buffer).size+1);
        }
 }
 
@@ -160,13 +174,17 @@ static void php_ob_init(uint initial_size, uint block_size)
 {
        OLS_FETCH();
 
-       if (OG(ob_buffer)) {
-               return;
+       if (OG(nesting_level)>0) {
+               if (OG(nesting_level)==1) { /* initialize stack */
+                       zend_stack_init(&OG(ob_buffers));
+               }
+               zend_stack_push(&OG(ob_buffers), &OG(active_ob_buffer), sizeof(php_ob_buffer));
        }
-       OG(ob_block_size) = block_size;
-       OG(ob_size) = initial_size;
-       OG(ob_buffer) = (char *) emalloc(initial_size+1);
-       OG(ob_text_length) = 0;
+       OG(nesting_level)++;
+       OG(active_ob_buffer).block_size = block_size;
+       OG(active_ob_buffer).size = initial_size;
+       OG(active_ob_buffer).buffer = (char *) emalloc(initial_size+1);
+       OG(active_ob_buffer).text_length = 0;
 }
 
 
@@ -174,10 +192,20 @@ static void php_ob_destroy()
 {
        OLS_FETCH();
 
-       if (OG(ob_buffer)) {
-               efree(OG(ob_buffer));
-               OG(ob_buffer) = NULL;
+       if (OG(nesting_level)>0) {
+               efree(OG(active_ob_buffer).buffer);
+               if (OG(nesting_level)>1) { /* restore previous buffer */
+                       php_ob_buffer *ob_buffer_p;
+
+                       zend_stack_top(&OG(ob_buffers), (void **) &ob_buffer_p);
+                       OG(active_ob_buffer) = *ob_buffer_p;
+                       zend_stack_del_top(&OG(ob_buffers));
+                       if (OG(nesting_level)==2) { /* destroy the stack */
+                               zend_stack_destroy(&OG(ob_buffers));
+                       }
+               } 
        }
+       OG(nesting_level)--;
 }
 
 
@@ -187,11 +215,11 @@ static void php_ob_append(const char *text, uint text_length)
        int original_ob_text_length;
        OLS_FETCH();
 
-       original_ob_text_length=OG(ob_text_length);
+       original_ob_text_length=OG(active_ob_buffer).text_length;
 
-       OG(ob_text_length) += text_length;
+       OG(active_ob_buffer).text_length += text_length;
        php_ob_allocate();
-       target = OG(ob_buffer)+original_ob_text_length;
+       target = OG(active_ob_buffer).buffer+original_ob_text_length;
        memcpy(target, text, text_length);
        target[text_length]=0;
 }
@@ -202,7 +230,7 @@ static void php_ob_prepend(const char *text, uint text_length)
        char *p, *start;
        OLS_FETCH();
 
-       OG(ob_text_length) += text_length;
+       OG(active_ob_buffer).text_length += text_length;
        php_ob_allocate();
 
        /* php_ob_allocate() may change OG(ob_buffer), so we can't initialize p&start earlier */
@@ -213,7 +241,7 @@ static void php_ob_prepend(const char *text, uint text_length)
                p[text_length] = *p;
        }
        memcpy(OG(ob_buffer), text, text_length);
-       OG(ob_buffer)[OG(ob_text_length)]=0;
+       OG(ob_buffer)[OG(active_ob_buffer).text_length]=0;
 }
 #endif
 
@@ -222,7 +250,7 @@ static inline void php_ob_send()
        OLS_FETCH();
 
        /* header_write is a simple, unbuffered output function */
-       OG(php_body_write)(OG(ob_buffer), OG(ob_text_length));
+       OG(php_body_write)(OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length);
 }
 
 
@@ -231,12 +259,12 @@ int php_ob_get_buffer(pval *p)
 {
        OLS_FETCH();
 
-       if (!OG(ob_buffer)) {
+       if (OG(nesting_level)==0) {
                return FAILURE;
        }
        p->type = IS_STRING;
-       p->value.str.val = estrndup(OG(ob_buffer), OG(ob_text_length));
-       p->value.str.len = OG(ob_text_length);
+       p->value.str.val = estrndup(OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length);
+       p->value.str.len = OG(active_ob_buffer).text_length;
        return SUCCESS;
 }
 
@@ -321,7 +349,7 @@ static int php_ub_body_write(const char *str, uint str_length)
    Turn on Output Buffering */
 PHP_FUNCTION(ob_start)
 {
-       php_start_ob_buffering();
+       php_start_ob_buffer();
 }
 /* }}} */
 
@@ -330,7 +358,7 @@ PHP_FUNCTION(ob_start)
    Flush (send) the output buffer, and turn off output buffering */
 PHP_FUNCTION(ob_end_flush)
 {
-       php_end_ob_buffering(1);
+       php_end_ob_buffer(1);
 }
 /* }}} */
 
@@ -339,7 +367,7 @@ PHP_FUNCTION(ob_end_flush)
    Clean (erase) the output buffer, and turn off output buffering */
 PHP_FUNCTION(ob_end_clean)
 {
-       php_end_ob_buffering(0);
+       php_end_ob_buffer(0);
 }
 /* }}} */
 
index 022715a056b2f2df59b39ec94a4fa42d71f88021..966d6dbe3508f09ab08c27ab95c244517d1d942a 100644 (file)
@@ -26,8 +26,9 @@
 PHPAPI void php_output_startup(void);
 PHPAPI int  php_body_write(const char *str, uint str_length);
 PHPAPI int  php_header_write(const char *str, uint str_length);
-PHPAPI void php_start_ob_buffering(void);
-PHPAPI void php_end_ob_buffering(int send_buffer);
+PHPAPI void php_start_ob_buffer(void);
+PHPAPI void php_end_ob_buffer(int send_buffer);
+PHPAPI void php_end_ob_buffers(int send_buffer);
 PHPAPI int php_ob_get_buffer(pval *p);
 PHPAPI void php_start_implicit_flush(void);
 PHPAPI void php_end_implicit_flush(void);
@@ -42,16 +43,22 @@ PHP_FUNCTION(ob_implicit_flush);
 
 PHP_GINIT_FUNCTION(output);
 
-typedef struct {
+typedef struct _php_ob_buffer {
+       char *buffer;
+       uint size;
+       uint text_length;
+       int block_size;
+} php_ob_buffer;
+
+typedef struct _php_output_globals {
        int (*php_body_write)(const char *str, uint str_length);                /* string output */
        int (*php_header_write)(const char *str, uint str_length);      /* unbuffer string output */
-       char *ob_buffer;
-       uint ob_size;
-       uint ob_block_size;
-       uint ob_text_length;
+       php_ob_buffer active_ob_buffer;
        unsigned char implicit_flush;
        char *output_start_filename;
        int output_start_lineno;
+       zend_stack ob_buffers;
+       int nesting_level;
 } php_output_globals;
 
 
index b6ea226274863cf8306a63d3c574dc771eab0361..25874c4a510c83a005e36301401842336c398214 100644 (file)
@@ -320,7 +320,7 @@ PHP_FUNCTION(virtual)
                RETURN_FALSE;
        }
        
-       php_end_ob_buffering(1);
+       php_end_ob_buffers(1);
        php_header();
 
        if (run_sub_req(rr)) {
index d9c3c7674bd0bb2161d17f754381802d63a7b9da..52e6002c3140135d36ee9e6617ba571ec210f2a7 100644 (file)
@@ -89,7 +89,7 @@ int apache_php_module_main(request_rec *r, int display_source_mode CLS_DC ELS_DC
        }
        
        php_header();                   /* Make sure headers have been sent */
-       php_end_ob_buffering(1);
+       php_end_ob_buffers(1);
        return (OK);
 }
 
index 7e9a00018cf45dc21e5ecb5d5181e2eabd52dc71..d61bea902fcbbee908c293ceabf4a8126479c191 100644 (file)
@@ -485,7 +485,7 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
                                        php_output_startup();
                                        SG(headers_sent) = 1;
                                        php_cgi_usage(argv[0]);
-                                       php_end_ob_buffering(1);
+                                       php_end_ob_buffers(1);
                                        exit(1);
                                        break;
                        }
@@ -556,7 +556,7 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
                                        php_output_startup();
                                        SG(headers_sent) = 1;
                                        php_cgi_usage(argv[0]);
-                                       php_end_ob_buffering(1);
+                                       php_end_ob_buffers(1);
                                        exit(1);
                                        break;
 
@@ -606,7 +606,7 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
                                                SG(headers_sent) = 1;
                                        }
                                        php_printf("%s\n", PHP_VERSION);
-                                       php_end_ob_buffering(1);
+                                       php_end_ob_buffers(1);
                                        exit(1);
                                        break;