From a000cbd9551953a70cd9dd5507bd393c97e69392 Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Wed, 12 Mar 2008 11:27:42 +0000 Subject: [PATCH] Fixed bug #44394 (Last two bytes missing from output) --- NEWS | 1 + .../tests/general_functions/bug44394.phpt | 18 ++++++++++++++ .../tests/general_functions/bug44394_2.phpt | 24 +++++++++++++++++++ ext/standard/url_scanner_ex.c | 2 +- 4 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 ext/standard/tests/general_functions/bug44394.phpt create mode 100644 ext/standard/tests/general_functions/bug44394_2.phpt diff --git a/NEWS b/NEWS index 8247e153c8..207534a539 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? Mar 2008 , PHP 5.2.6 +- Fixed bug #44394 (Last two bytes missing from output). (Felipe) - Fixed bug #44373 (PDO_OCI extension compile failed). (Felipe) 06 Mar 2008, PHP 5.2.6RC2 diff --git a/ext/standard/tests/general_functions/bug44394.phpt b/ext/standard/tests/general_functions/bug44394.phpt new file mode 100644 index 0000000000..3a619283c0 --- /dev/null +++ b/ext/standard/tests/general_functions/bug44394.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #44394 Last two bytes missing from output +--FILE-- +asd"; + +output_add_rewrite_var('a', 'b'); + +echo $string; + +ob_flush(); + +ob_end_clean(); + +?> +--EXPECT-- +asd diff --git a/ext/standard/tests/general_functions/bug44394_2.phpt b/ext/standard/tests/general_functions/bug44394_2.phpt new file mode 100644 index 0000000000..561c63151c --- /dev/null +++ b/ext/standard/tests/general_functions/bug44394_2.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #44394 (Last two bytes missing from output) with session.use_trans_id +--FILE-- +asd"; + +output_add_rewrite_var('a', 'b'); + +echo $string; + +ob_flush(); + +ob_end_clean(); + +?> +--EXPECTF-- +asd diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c index f8b8b6a345..9cc2c16293 100644 --- a/ext/standard/url_scanner_ex.c +++ b/ext/standard/url_scanner_ex.c @@ -1007,7 +1007,7 @@ static void php_url_scanner_output_handler(char *output, uint output_len, char * size_t len; if (BG(url_adapt_state_ex).url_app.len != 0) { - *handled_output = url_adapt_ext(output, output_len, &len, (zend_bool) (mode & PHP_OUTPUT_HANDLER_END ? 1 : 0) TSRMLS_CC); + *handled_output = url_adapt_ext(output, output_len, &len, (zend_bool) (mode & (PHP_OUTPUT_HANDLER_END | PHP_OUTPUT_HANDLER_CONT) ? 1 : 0) TSRMLS_CC); if (sizeof(uint) < sizeof(size_t)) { if (len > UINT_MAX) len = UINT_MAX; -- 2.40.0