php.net |  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
Votes:1
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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: david at sickmiller dot com
New email:
PHP Version: OS:

 

 [2007-07-20 18:45 UTC] david at sickmiller dot com
Description:
------------
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.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-10-06 20:39 UTC] bishop@php.net
-Status: Open +Status: Duplicate -Package: Feature/Change Request +Package: *General Issues
 [2015-10-06 20:39 UTC] bishop@php.net
Calling this a duplicate of https://bugs.php.net/bug.php?id=34882
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC