Bug #67262 [Com]: bug in libapache2-mod-php5filter
| From: | rmn1024 at gmail dot com | Date: | Thu, 29 May 2014 12:16:41 +0000 |
| Subject: | Bug #67262 [Com]: bug in libapache2-mod-php5filter | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-185968@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67262&edit=1
ID: 67262
Comment by: rmn1024 at gmail dot com
Reported by: vladget at gmail dot com
Summary: bug in libapache2-mod-php5filter
Status: Open
Type: Bug
Package: Apache2 related
Operating System: Ubuntu
PHP Version: 5.4.28
Block user comment: N
Private report: N
New Comment:
There is also bug with non-array POST-variables. But it looks little different because variables
append to last.
If you send in POST body:
a=123
You will receive
array(1) {
["a"]=>
string(8) "123a=123"
}
Previous Comments:
------------------------------------------------------------------------
[2014-05-12 18:52:57] vladget at gmail dot com
Description:
------------
Hello!
php5filter duplicate data in POST from forms used as
arrays(http://us2.php.net/manual/en/faq.html.php#faq.html.arrays)
Here is simple way to reproduce it:
cat f.php
<!DOCTYPE html>
<html>
<head>
<meta charset="windows-1251">
</head>
<body>
<form action="f.php" method="post"
enctype="multipart/form-data">
<input type="text" name="a">
<input type="text" name="b[]">
<input type="text" name="b[]">
<button type="submit">submit</button>
</form>
<?php
if (!empty($_POST)) {
echo '<pre>';
echo "POST:\n";
var_dump($_POST);
echo '</pre>';
}
?>
</body>
</html>
libapache2-mod-php5filter as apache mod_php:
["a"]=>
string(1) "1"
["b"]=>
array(4) {
[0]=>
string(1) "2"
[1]=>
string(1) "3"
[2]=>
string(1) "2"
[3]=>
string(1) "3"
but it works fine with libapache2-mod-php5 as apache mod_php:
array(2) {
["a"]=>
string(1) "1"
["b"]=>
array(2) {
[0]=>
string(1) "2"
[1]=>
string(1) "3"
Test script:
---------------
<!DOCTYPE html>
<html>
<head>
<meta charset="windows-1251">
</head>
<body>
<form action="f.php" method="post"
enctype="multipart/form-data">
<input type="text" name="a">
<input type="text" name="b[]">
<input type="text" name="b[]">
<button type="submit">submit</button>
</form>
<?php
if (!empty($_POST)) {
echo '<pre>';
echo "POST:\n";
var_dump($_POST);
echo '</pre>';
}
?>
</body>
</html>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67262&edit=1