|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-01-08 17:51 UTC] sniper@php.net
[2006-01-08 18:42 UTC] ernest at vogelsinger dot at
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 08:00:01 2025 UTC |
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>