From: Operating system: * PHP version: trunk-SVN-2011-05-13 (SVN) Package: Output Control Bug Type: Bug Bug description:ob_flush() before output_reset_rewrite_vars() results in data loss
Description: ------------ The test for http://bugs.php.net/bug.php?id=26862 currently fails and results in the last echo statement (everything after ob_flush() and output_reset_rewrite_vars()) to get lost. A variant of the issue was reintroduced after the output buffering rewrite. This seems to happen because the output is never handled if there is no rewrite variables to process and there is no active buffer with contents. The output chars still needs to returned as handled. The patch also contains a small change in the test to better differentiate the two echo statements. Test script: --------------- Based on: ext/session/tests/bug26862.phpt <?php session_start(); output_add_rewrite_var('var', 'value'); echo '<a href="file-first.php">link</a>'; ob_flush(); output_reset_rewrite_vars(); echo '<a href="file-second.php">link</a>'; Expected result: ---------------- <a href="file-first.php?var=value">link</a><a href="file-second.php">link</a> Actual result: -------------- <a href="file-first.php?var=value">link</a> -- Edit bug report at http://bugs.php.net/bug.php?id=54727&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54727&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54727&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54727&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=54727&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54727&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=54727&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=54727&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=54727&r=needscript Try newer version: http://bugs.php.net/fix.php?id=54727&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=54727&r=support Expected behavior: http://bugs.php.net/fix.php?id=54727&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=54727&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=54727&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=54727&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54727&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=54727&r=dst IIS Stability: http://bugs.php.net/fix.php?id=54727&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=54727&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=54727&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=54727&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=54727&r=mysqlcfg