php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63637 POST value duplicated when passed to PHP
Submitted: 2012-11-28 17:24 UTC Modified: 2013-02-18 00:36 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: sarciszewski at knights dot ucf dot edu Assigned:
Status: No Feedback Package: Apache2 related
PHP Version: 5.4.9 OS: Debian
Private report: No CVE-ID: None
 [2012-11-28 17:24 UTC] sarciszewski at knights dot ucf dot edu
Description:
------------
Originally I thought this was an Apache bug since php://input held duplicate POST data. https://issues.apache.org/bugzilla/show_bug.cgi?id=54218 - However, Perl correctly reads single values.

admin@summit:$uname -a
Linux summit 2.6.26-2-686-bigmem #1 SMP Sun Mar 4 23:05:22 UTC 2012 i686 GNU/Linux
admin@summit:$/usr/sbin/apache2 -v
Server version: Apache/2.2.16 (Debian)
Server built:   Sep  9 2012 21:17:33
admin@summit:$ /usr/bin/php5 -v
PHP 5.4.9-1~dotdeb.0 (cli) (built: Nov 26 2012 04:24:47)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

Test script:
---------------
<?
if(!empty($_POST)) {
  header("Content-Type: text/plain");
  echo file_get_contents('php://input');
  echo "\n=========================================================\n";
  var_dump($_POST); exit;
}
?>
This duplicates:
<form method="post" target="_blank">
    <input type="text" name="menu" value="Blah" />
    <input type="submit" />
</form>
<p>This doesn't:</p>
<form method="post" target="_blank">
    <input type="text" name="menu" value="Blah" />
    <input type="text" name="second" value="Second value" />
    <input type="submit" />
</form>

Expected result:
----------------
Output (first button):
menu=Blah
=========================================================
array(1) {
  ["menu"]=>
  string(4) "Blah"
}
Output (second button):
menu=Blah&second=Second+value
=========================================================
array(2) {
  ["menu"]=>
  string(4) "Blah"
  ["second"]=>
  string(12) "Second value"
}

Actual result:
--------------
Output (first button):
menu=Blahmenu=Blah
=========================================================
array(1) {
  ["menu"]=>
  string(13) "Blahmenu=Blah"
}
Output (second button):
menu=Blah&second=Second+valuemenu=Blah&second=Second+value
=========================================================
array(2) {
  ["menu"]=>
  string(4) "Blah"
  ["second"]=>
  string(12) "Second value"
}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-11-28 18:03 UTC] sarciszewski at knights dot ucf dot edu
Downgrading to PHP 5.3.19 resolved the issue. Is there something in the code that links Apache2 and PHP 5.4.9 that could be causing this problem? It wasn't causing issues in 5.4.8
 [2012-12-03 09:32 UTC] mike@php.net
What PHP extensions are loaded?
 [2012-12-03 09:32 UTC] mike@php.net
-Status: Open +Status: Feedback
 [2012-12-03 10:51 UTC] sarciszewski at knights dot ucf dot edu
Whatever gets installed via:
apt-get install php5 php5-common php5-mysql php5-cli php5-curl

From the dotdeb repository (which offers 5.4)
 [2013-02-18 00:36 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 11:01:30 2024 UTC