diff options
author | Felipe Pena <felipe@php.net> | 2008-03-12 02:40:57 +0000 |
---|---|---|
committer | Felipe Pena <felipe@php.net> | 2008-03-12 02:40:57 +0000 |
commit | e0de453954d07f7e3285d9d6d66427f5caedd124 (patch) | |
tree | 1ef4361b070f56dde280a610788abd1d5bf6a2f8 /ext/standard | |
parent | b9f72771a613634973867888100a0a083d5d2e73 (diff) | |
download | php-git-e0de453954d07f7e3285d9d6d66427f5caedd124.tar.gz |
Fixed bug #44394 (Last two bytes missing from output)
Diffstat (limited to 'ext/standard')
-rw-r--r-- | ext/standard/tests/general_functions/bug44394.phpt | 18 | ||||
-rw-r--r-- | ext/standard/tests/general_functions/bug44394_2.phpt | 24 | ||||
-rw-r--r-- | ext/standard/url_scanner_ex.c | 2 |
3 files changed, 43 insertions, 1 deletions
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-- +<?php + +$string = "<a href='a?q=1'>asd</a>"; + +output_add_rewrite_var('a', 'b'); + +echo $string; + +ob_flush(); + +ob_end_clean(); + +?> +--EXPECT-- +<a href='a?q=1&a=b'>asd</a> 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-- +<?php + +ini_set('session.use_trans_sid', 1); + +session_start(); + +ob_start(); + +$string = "<a href='a?q=1'>asd</a>"; + +output_add_rewrite_var('a', 'b'); + +echo $string; + +ob_flush(); + +ob_end_clean(); + +?> +--EXPECTF-- +<a href='a?q=1&PHPSESSID=%s&a=b'>asd</a> diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c index 4244d9f5af..c7911ed7a9 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; |