php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43234 URL rewrite mechanism
Submitted: 2007-11-10 09:50 UTC Modified: 2007-11-10 22:19 UTC
From: rinat at avtorif dot ru Assigned:
Status: Not a bug Package: Output Control
PHP Version: 5.2.5 OS: windows 2000
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: rinat at avtorif dot ru
New email:
PHP Version: OS:

 

 [2007-11-10 09:50 UTC] rinat at avtorif dot ru
Description:
------------
URL rewrite mechanism just add variables in existing links, but not replace.


Reproduce code:
---------------
<script>
  if (navigator.cookieEnabled) alert('To take effect, please turn off cookie support in your browser!');
</script>
<a href="/?sid=qfa0pr1tdrs5quuiglsd239s03">correct link</a><br />
<a href="/?sid=qfa0pr1tdrs5quuiglsd239s03&sid=qfa0pr1tdrs5quuiglsd239s03">incorrect link?</a><br />
<form action="/"><input type="hidden" name="sid" value="qfa0pr1tdrs5quuiglsd239s03" />
  <input type="hidden" name="sid" value="qfa0pr1tdrs5quuiglsd239s03" />
  <input type="submit">
</form>

Expected result:
----------------
<script>
  if (navigator.cookieEnabled) alert('To take effect, please turn off cookie support in your browser!');
</script>
<a href="/?sid=qfa0pr1tdrs5quuiglsd239s03">correct link</a><br />
<a href="/?sid=qfa0pr1tdrs5quuiglsd239s03">incorrect link?</a><br />
<form action="/">
  <input type="hidden" name="sid" value="qfa0pr1tdrs5quuiglsd239s03" />
  <input type="submit">
</form>

Actual result:
--------------
<script>
  if (navigator.cookieEnabled) alert('To take effect, please turn off cookie support in your browser!');
</script>
<a href="/?sid=qfa0pr1tdrs5quuiglsd239s03">correct link</a><br />
<a href="/?sid=qfa0pr1tdrs5quuiglsd239s03&sid=qfa0pr1tdrs5quuiglsd239s03">incorrect link?</a><br />
<form action="/"><input type="hidden" name="sid" value="qfa0pr1tdrs5quuiglsd239s03" />
  <input type="hidden" name="sid" value="qfa0pr1tdrs5quuiglsd239s03" />
  <input type="submit">
</form>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-11-10 09:55 UTC] rinat at avtorif dot ru
Sorry, correct Reproduce code here:
----------------------------------
<?
session_name('sid');
session_start();
$sid = session_id();
if (SID) output_add_rewrite_var(session_name(), session_id());
?>
<script>
  if (navigator.cookieEnabled) alert('To take effect, please turn off cookie support in your browser!');
</script>
<a href="/">correct link</a><br />
<a href="/?sid=<?=$sid?>">incorrect link?</a><br />
<form action="/">
  <input type="hidden" name="sid" value="<?=$sid?>" />
  <input type="submit">
</form>
 [2007-11-10 22:19 UTC] jani@php.net
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


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 01:01:33 2025 UTC