|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-01-21 21:54 UTC] jeff at wecreate dot com
Description:
------------
multiple calls to output_add_rewrite_var() with identical vars creates multiple entries on the link.
Reproduce code:
---------------
output_add_rewrite_var("var","a");
output_add_rewrite_var("var","b");
echo '<a href="test.php">test</a>';
Expected result:
----------------
<a href="test.php?var=b">test</a>
Actual result:
--------------
<a href="test.php?var=a&var=b">test</a>
this is useless as var can only have one value.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 08:00:01 2025 UTC |
I would assume that in the case where the variables are identical, the second call would 'overwrite' the value of the first call. for example: <? $foo = "bar"; $foo = "bar2"; echo $foo; ?> would result in "bar2". so I would assume <? output_add_rewrite_var("var","a"); output_add_rewrite_var("var","b"); echo '<a href="test.php">test</a>'; ?> would result in: "<a href="test.php?var=b">test</a>". More to the point, If I call output_add_rewrite_var("var","a") twice in the same script, it doesn't make sense that it would add ? var=a&var=a , it should only add var=a once. Thanks.