#35933 [Opn->Bgs]: URL rewriting fails on ob_get_contents()
| From: | sniper@php.net | Date: | Sun, 08 Jan 2006 16:51:50 +0000 |
| Subject: | #35933 [Opn->Bgs]: URL rewriting fails on ob_get_contents() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-91661@lists.php.net to get a copy of this message | ||
ID: 35933
Updated by: sniper@php.net
Reported By: ernest at vogelsinger dot at
-Status: Open
+Status: Bogus
Bug Type: Output Control
Operating System: any
PHP Version: 5.1.1
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Previous Comments:
------------------------------------------------------------------------
[2006-01-08 17:46:13] ernest at vogelsinger dot at
Description:
------------
URL Rewriting fails on ob_get_contents().
Note: the workaround is to have second buffering envelope which gets
flushed into the first, thus triggering the URL rewrite. The two lines
necessary for the workaround are commented out in the code example.
Reproduce code:
---------------
<?php
$output = <<<EOF
<html><body>
<a href=".">self link</a>
</body></html>
EOF;
ob_start();
// *** ob_start();
session_start();
echo $output;
// *** ob_end_flush();
$data = ob_get_contents();
ob_end_clean();
echo '<xmp>';
if (defined('SID'))
echo 'URL should be rewritten having: ', SID, "\n";
else
echo "No SID, no rewritten URL\n";
echo "<xmp>$data</xmp>";
?>
Expected result:
----------------
URL should be rewritten having:
PHPSESSID=667e6b2bde474a2820c8e0f8dc41200f
<html><body>
<a href=".?PHPSESSID=667e6b2bde474a2820c8e0f8dc41200f">self link</a>
</body></html>
Actual result:
--------------
URL should be rewritten having:
PHPSESSID=667e6b2bde474a2820c8e0f8dc41200f
<html><body>
<a href=".">self link</a> </body></html>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35933&edit=1