Req #75121 [Com]: PHP cuts out charset information from content-type in file uploads
| From: | danack@php.net | Date: | Fri, 25 Aug 2017 15:19:52 +0000 |
| Subject: | Req #75121 [Com]: PHP cuts out charset information from content-type in file uploads | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-210812@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75121&edit=1
ID: 75121
Comment by: danack@php.net
Reported by: jocrutrisi at ibsats dot com
Summary: PHP cuts out charset information from content-type
in file uploads
Status: Open
Type: Feature/Change Request
Package: Unknown/Other Function
Operating System: All
PHP Version: 7.2.0beta3
Block user comment: N
Private report: N
New Comment:
Wow....that's something.
Could you post an example for content-type string so that when it gets fixed, someone has an example
to add as a test.
Previous Comments:
------------------------------------------------------------------------
[2017-08-25 15:12:20] jocrutrisi at ibsats dot com
Description:
------------
Seems like PHP cuts out attributes, including charset, from "Content-Type" when assigning
the "type" attribute in file uploads: https://github.com/php/php-src/blob/c8aa6f3a9a3d2c114d0c5e0c9fdd0a465dbb54a5/main/rfc1867.c#L1180
That's information loss, this information is important when processing text uploads.
I realize doing the right thing (assigning full type to "type") is now not an option for
BC reasons.
But I'd like to propose that we add another field to the $_FILES file entry,
"charset", which contains the charset when it's there (and when it's not, the
field can be missing or null).
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75121&edit=1