Bug #54727 [Opn->Asn]: ob_flush() before output_reset_rewrite_vars() results in data loss
Edit report at http://bugs.php.net/bug.php?id=54727&edit=1
ID: 54727
Updated by: felipe@php.net
Reported by: mats dot lindh at gmail dot com
Summary: ob_flush() before output_reset_rewrite_vars()
results in data loss
-Status: Open
+Status: Assigned
Type: Bug
Package: Output Control
Operating System: *
PHP Version: trunk-SVN-2011-05-13 (SVN)
-Assigned To:
+Assigned To: mike
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[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
Thread (3 messages)