|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #42055 FR: Allow access to non-mangled form field names regardless of enctype.
Submitted: 2007-07-20 18:45 UTC Modified: 2015-10-06 20:39 UTC
Avg. Score:1.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: david at sickmiller dot com Assigned:
Status: Duplicate Package: *General Issues
PHP Version: 5.2.3 OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
47 - 34 = ?
Subscribe to this entry?

 [2007-07-20 18:45 UTC] david at sickmiller dot com
It should be possible to access to non-mangled form field names regardless of enctype.

Background: PHP automagically formats $_POST by treating square brackets ([]) in the form names as array indicators.  PHP also converts whitespaces and other special characters to underscores (_).  Normally, this is useful.  However, it causes problems when using complicated form field names, such as those with square brackets, whitespaces, and punctuation.  Using special characters in form field names is valid HTML.

When the form enctype="application/x-www-form-urlencoded", the raw data is accessible via file_get_contents('php://input'), and it is possible to construct a non-mangled version of the submitted form fields.

When the form enctype="multipart/form-data", the raw data is NOT accessible via file_get_contents('php://input') or any other means.  Thus, it is not possible to accept file uploads and still access the original field names.

This is similar to Bug #34882, except that I am not aware of any work-around.

I understand that mangling the form field names is often convenient, but it shouldn't be *impossible* to access the raw field names.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-10-06 20:39 UTC]
-Status: Open +Status: Duplicate -Package: Feature/Change Request +Package: *General Issues
 [2015-10-06 20:39 UTC]
Calling this a duplicate of
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Oct 26 03:03:35 2021 UTC