php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33759 single POST variable is corrupted
Submitted: 2005-07-19 00:07 UTC Modified: 2005-07-19 01:11 UTC
From: kyle dot grieser-c at iovation dot com Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 4.3.11 OS: linux
Private report: No CVE-ID: None
 [2005-07-19 00:07 UTC] kyle dot grieser-c at iovation dot com
Description:
------------
A form of type POST that contains a single form element will corrupt the incoming value.  

What I get is this: formvalue="valueformvalue=value"    

What I expect is this: formvalue="value"

Yuck!  I found a very old bug report consistent with this from 2002 ( http://bugs.php.net/bug.php?id=18648 ) that suggested adding a hidden form element like this:

                                                                        <input type=hidden name=bugfix>

This does indeed fix the problem, but seems like this bug has returned in a recent version of PHP.  Is there a fix?
I could not find any other bugs matching this report, and believe it was reintroduced with 4.3.11.
                                                                               


Reproduce code:
---------------
<html>
<body>
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') { 
  $formvalue = trim($_POST['formvalue']);
                                                                                
  print "Recieved from Post: '". $formvalue."'";
}
?>
<form action="#" method="post">
<p>
  FORM VALUE:<br><br><input type="text" name="formvalue" value="" size="50" maxlength="50"></td>
  <input type= submit value=submit>
</p>
</form>
</body>
</html>


Expected result:
----------------
I expect this:

formvalue=value

Actual result:
--------------
I get this:

formvalue=valueformvalue=value

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-19 00:53 UTC] sniper@php.net
It's just misconfiguration. Please don't report this as bug anymore.
 [2005-07-19 01:11 UTC] kyle dot grieser-c at iovation dot com
If this is indeed misconfiguration, some information on how/why it is misconfigured sure would be nice.

Your response, as is, is frustrating and USELESS!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 27 20:01:32 2024 UTC