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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 05:01:30 2024 UTC