#34701 [Csd->Bgs]: url_rewriter.tags won't work with output buffer and eval
ID: 34701
Updated by: johannes@php.net
Reported By: php dot net at callerid dot de
-Status: Closed
+Status: Bogus
Bug Type: Session related
Operating System: linux, windows
PHP Version: 5CVS-2005-10-01 (snap)
New Comment:
No PHP problem -> bogus
Previous Comments:
------------------------------------------------------------------------
[2005-10-01 18:59:01] php dot net at callerid dot de
Closed.
------------------------------------------------------------------------
[2005-10-01 18:58:21] php dot net at callerid dot de
OK. I found it out myself.
Because of the ob_end... the output buffer, that url_rewriting is
obviously using, is stopped.
That is also an unexpected behaviour and should be explained in the
documentation of the session-functions. I will post a note.
Sorry about this bug-report. But the answer wasn't very helpful.
------------------------------------------------------------------------
[2005-10-01 18:00:16] php dot net at callerid dot de
Sorry. It isn't expected, why?
------------------------------------------------------------------------
[2005-10-01 16:58:16] sniper@php.net
It's not expected.
------------------------------------------------------------------------
[2005-10-01 16:53:53] php dot net at callerid dot de
Description:
------------
If an output is produced inside an eval that is captured in an output
buffer, the url will not be supplemented with the session-ID as
expected.
This happens only if the session_start is also inside the eval'd code.
The behaviour can be reproduced independently from OS or PHP-Version,
if session.use-trans-sid is set.
Reproduce code:
---------------
<?php
$source = <<<EOQ
session_start();
echo "<a href=\"index.html\">Testlink</a>";
EOQ;
ob_start();
eval($source);
$content = ob_get_contents();
ob_end_clean();
echo $content;
?>
Expected result:
----------------
<a href="index.html?PHPSESSID=.....">Testlink</a>
Actual result:
--------------
<a href="index.html">Testlink</a>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34701&edit=1
Thread (7 messages)