php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35642 POST var corrupted when single variable posted
Submitted: 2005-12-12 11:57 UTC Modified: 2005-12-20 01:00 UTC
From: ray at wirestorm dot net Assigned:
Status: No Feedback Package: Apache2 related
PHP Version: 5.1.1 OS: Debian Linux
Private report: No CVE-ID: None
 [2005-12-12 11:57 UTC] ray at wirestorm dot net
Description:
------------
Apache2 Filter + PHP 5.1.1

When posting a SINGLE post var, the post var appears corrupted, (the raw post data, it seems, is appended to the end of the value).

When posting multiple post vars, the problem does not appear.

here is my config settings:

'./configure' '--with-xml' '--with-layout=GNU' '--with-config-file-path=/etc/php5' '--with-config-file-scan-path=/etc/php5' '--with-sockets' '--with-mbstring' '--enable-exif' '--enable-xslti' '--prefix=/usr' '--with-xsl' '--with-dom' '--with-mysql=/usr/local' '--with-zlib' '--with-bzip' '--with-gd' '--enable-shared-pdflib' '--with-gettext' '--enable-mailparse' '--with-curl=/usr' '--enable-exif' '--with-jpeg-dir=/usr/lib/' '--with-png-dir=/usr/lib/' '--with-ttf=/usr/lib/libttf.so' '--enable-gd-native-ttf' '--with-xpm-dir=/usr/' '--enable-apc' '--enable-apd' '--with-mcrypt' '--with-mhash' '--enable-soap' '--with-apxs2filter=/usr/bin/apxs2'


And a test script is here: http://n0de.net/php-test/

Additionally, a simple perl script doing the same thing produces the CORRECT result (ie, no post var corruption).

Reproduce code:
---------------
<?
        var_dump($_POST);
?>      
<form action='.' method='post'>
        <textarea name='cmd'></textarea>
        <input type='submit' />
</form>

Expected result:
----------------
array(1) {
  ["cmd"]=>
  string(16) "sdfsdf"
}

Actual result:
--------------
array(1) {
  ["cmd"]=>
  string(16) "sdfsdfcmd=sdfsdf"
}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-12 12:25 UTC] ray at wirestorm dot net
Additionally, this is when the filter is configured as: 

<Files *.php>
       SetOutputFilter PHP
       SetInputFilter PHP
</Files>

This is the ONLY reference to php (except for the DirectoryIndex and LoadModule directives) in my apache2 config, therefore I do not beleive that the two types of php configuration are conflicting.

Replacing this with:

AddType application/x-httpd-php .php

Works, so presumably its an issue with PHP + Apache2 Filters?  I have had to change my server to use the AddType directive to get things working, so the example script on n0de.net now works.
 [2005-12-12 12:33 UTC] tony2001@php.net
Works fine with PHP 5.1-CVS and Apache 2.0.54/worker.
 [2005-12-20 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 21:01:28 2024 UTC