Edit report at http://bugs.php.net/bug.php?id=54727&edit=1
ID: 54727 Updated by: m...@php.net Reported by: mats dot lindh at gmail dot com Summary: ob_flush() before output_reset_rewrite_vars() results in data loss -Status: Assigned +Status: Closed Type: Bug Package: Output Control Operating System: * PHP Version: trunk-SVN-2011-05-13 (SVN) Assigned To: mike Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2011-05-23 12:42:02] m...@php.net Automatic comment from SVN on behalf of mike Revision: http://svn.php.net/viewvc/?view=revision&revision=311348 Log: Fix Bug #54727, a re-incarnation of #26862 ------------------------------------------------------------------------ [2011-05-13 14:00:06] mats dot lindh at gmail dot com 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 this bug report at http://bugs.php.net/bug.php?id=54727&edit=1