From: [email]daveyphp.net[/email]
Operating system: WinXP/FreeBSD
PHP version: 4CVS-2003-09-26 (stable)
PHP Bug Type: Session related
Bug description: Form hidden input ouput when any form=* is in url_rewriter.tags

Description:
------------
Despite there being no form=fakeentry or form= (as I understand it,
providing no value is the same as giving fakeentry) in url_rewriter.tags
the form hidden element for the PHPSESSID is still output.

I am trying to use form=action as the url_rewriter.tags and whilst this IS
rewritten correctly, the hidden element is still being inserted. It seems
that the fallback mechanism is faulty.

This has been tested on several builds:
PHP 4.3.3RC4 WinXP
Latest Snapshot (200309270130) WinXP

PHP 4.3.3 FreeBSD
Latest Snapshot (200309270130) FreeBSD

I have also had someone reporting the CORRECT behaviour on Debian with
latest CVS so its quite the puzzle...

- Davey

Reproduce code:
---------------
<?php
session_start();
setcookie('PHPSESSID','',0); /* needed if session.use_cookies is still on
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled</title>
</head>
<body>
<?php
ini_set('url_rewriter.tags','a=href,area=href,fram e=src,input=src,form=action,foo=bar');
echo ini_get("url_rewriter.tags") . "<br />";
if(isset($_GET)) {
var_dump($_GET);
}
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">
<p>
Foo: <input type="text" name="foo" value="" />
<br />
Bar: <input type="text" name="bar" value="" />
<br />
<input type="submit" value="Test!" />
</p>
<foo href="foo.php" bar="null" />
</form>
</body>
</html>

Expected result:
----------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled</title>
</head>

<body>
a=href,area=href,frame=src,input=src,form=action,f oo=bar<br />array(0)
{
}
<form
action="/test/url_rewrite_form_action.php?PHPSESSID=6a5b43d2aef8 e2e3158e44fbd3df5d9d"
method="get"><input type="hidden" name="PHPSESSID"
value="6a5b43d2aef8e2e3158e44fbd3df5d9d" />
<p>
Foo: <input type="text" name="foo" value="" />
<br />
Bar: <input type="text" name="bar" value="" />
<br />

<input type="submit" value="Test!" />
</p>
<foo href="foo.php"
bar="null?PHPSESSID=6a5b43d2aef8e2e3158e44fbd3df5d 9d" />
</form>
</body>
</html>

Actual result:
--------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled</title>
</head>

<body>
a=href,area=href,frame=src,input=src,form=action,f oo=bar<br />array(0)
{
}
<form
action="/test/url_rewrite_form_action.php?PHPSESSID=6a5b43d2aef8 e2e3158e44fbd3df5d9d"
method="get"><input type="hidden" name="PHPSESSID"
value="6a5b43d2aef8e2e3158e44fbd3df5d9d" />
<p>
Foo: <input type="text" name="foo" value="" />
<br />
Bar: <input type="text" name="bar" value="" />
<br />

<input type="submit" value="Test!" />
</p>
<foo href="foo.php"
bar="null?PHPSESSID=6a5b43d2aef8e2e3158e44fbd3df5d 9d" />
</form>
</body>
</html>

--
Edit bug report at [url]http://bugs.php.net/?id=25676&edit=1[/url]
--
Try a CVS snapshot (php4): [url]http://bugs.php.net/fix.php?id=25676&r=trysnapshot4[/url]
Try a CVS snapshot (php5): [url]http://bugs.php.net/fix.php?id=25676&r=trysnapshot5[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=25676&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=25676&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=25676&r=needtrace[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=25676&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=25676&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=25676&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=25676&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=25676&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=25676&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=25676&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=25676&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=25676&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=25676&r=gnused[/url]
Floating point limitations: [url]http://bugs.php.net/fix.php?id=25676&r=float[/url]