]> granicus.if.org Git - php/commitdiff
Fixed bug #44394 (Last two bytes missing from output)
authorFelipe Pena <felipe@php.net>
Wed, 12 Mar 2008 11:27:42 +0000 (11:27 +0000)
committerFelipe Pena <felipe@php.net>
Wed, 12 Mar 2008 11:27:42 +0000 (11:27 +0000)
NEWS
ext/standard/tests/general_functions/bug44394.phpt [new file with mode: 0644]
ext/standard/tests/general_functions/bug44394_2.phpt [new file with mode: 0644]
ext/standard/url_scanner_ex.c

diff --git a/NEWS b/NEWS
index 8247e153c8fe1cacfe2d748be85ddc5328042dac..207534a5395d19a029362364944a9f3f6482de87 100644 (file)
--- 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 (file)
index 0000000..3a61928
--- /dev/null
@@ -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 (file)
index 0000000..561c631
--- /dev/null
@@ -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>
index f8b8b6a345f52496227484857cb31125384c89ef..9cc2c16293817e1fccd7cbc65c49dd31778dd732 100644 (file)
@@ -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;