summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/output.c10
-rw-r--r--ext/standard/php_output.h2
-rw-r--r--main/output.c10
-rw-r--r--main/php_output.h2
4 files changed, 12 insertions, 12 deletions
diff --git a/ext/standard/output.c b/ext/standard/output.c
index 6055439725..59fe87c761 100644
--- a/ext/standard/output.c
+++ b/ext/standard/output.c
@@ -123,7 +123,6 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush)
int final_buffer_length=0;
zval *alternate_buffer=NULL;
char *to_be_destroyed_buffer;
- char *internal_output_handler_buffer;
int status;
SLS_FETCH();
OLS_FETCH();
@@ -143,8 +142,9 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush)
}
if (OG(active_ob_buffer).internal_output_handler) {
- internal_output_handler_buffer = OG(active_ob_buffer).internal_output_handler_buffer;
- OG(active_ob_buffer).internal_output_handler(OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length, &internal_output_handler_buffer, status);
+ final_buffer = OG(active_ob_buffer).internal_output_handler_buffer;
+ final_buffer_length = OG(active_ob_buffer).internal_output_handler_buffer_size;
+ OG(active_ob_buffer).internal_output_handler(OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length, &final_buffer, &final_buffer_length, status);
} else if (OG(active_ob_buffer).output_handler) {
zval **params[2];
zval *orig_buffer;
@@ -196,8 +196,8 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush)
if (!just_flush) {
if (OG(active_ob_buffer).internal_output_handler
- && (internal_output_handler_buffer != OG(active_ob_buffer).internal_output_handler_buffer)) {
- efree(internal_output_handler_buffer);
+ && (final_buffer != OG(active_ob_buffer).internal_output_handler_buffer)) {
+ efree(final_buffer);
}
if (OG(nesting_level)>1) { /* restore previous buffer */
php_ob_buffer *ob_buffer_p;
diff --git a/ext/standard/php_output.h b/ext/standard/php_output.h
index 3bfd5d078c..39bb8954b2 100644
--- a/ext/standard/php_output.h
+++ b/ext/standard/php_output.h
@@ -23,7 +23,7 @@
#include "php.h"
-typedef void (*php_output_handler_func_t)(char *output, uint output_len, char **handled_output, int mode);
+typedef void (*php_output_handler_func_t)(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode);
PHPAPI void php_output_startup(void);
void php_output_register_constants(void);
diff --git a/main/output.c b/main/output.c
index 6055439725..59fe87c761 100644
--- a/main/output.c
+++ b/main/output.c
@@ -123,7 +123,6 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush)
int final_buffer_length=0;
zval *alternate_buffer=NULL;
char *to_be_destroyed_buffer;
- char *internal_output_handler_buffer;
int status;
SLS_FETCH();
OLS_FETCH();
@@ -143,8 +142,9 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush)
}
if (OG(active_ob_buffer).internal_output_handler) {
- internal_output_handler_buffer = OG(active_ob_buffer).internal_output_handler_buffer;
- OG(active_ob_buffer).internal_output_handler(OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length, &internal_output_handler_buffer, status);
+ final_buffer = OG(active_ob_buffer).internal_output_handler_buffer;
+ final_buffer_length = OG(active_ob_buffer).internal_output_handler_buffer_size;
+ OG(active_ob_buffer).internal_output_handler(OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length, &final_buffer, &final_buffer_length, status);
} else if (OG(active_ob_buffer).output_handler) {
zval **params[2];
zval *orig_buffer;
@@ -196,8 +196,8 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush)
if (!just_flush) {
if (OG(active_ob_buffer).internal_output_handler
- && (internal_output_handler_buffer != OG(active_ob_buffer).internal_output_handler_buffer)) {
- efree(internal_output_handler_buffer);
+ && (final_buffer != OG(active_ob_buffer).internal_output_handler_buffer)) {
+ efree(final_buffer);
}
if (OG(nesting_level)>1) { /* restore previous buffer */
php_ob_buffer *ob_buffer_p;
diff --git a/main/php_output.h b/main/php_output.h
index 3bfd5d078c..39bb8954b2 100644
--- a/main/php_output.h
+++ b/main/php_output.h
@@ -23,7 +23,7 @@
#include "php.h"
-typedef void (*php_output_handler_func_t)(char *output, uint output_len, char **handled_output, int mode);
+typedef void (*php_output_handler_func_t)(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode);
PHPAPI void php_output_startup(void);
void php_output_register_constants(void);