Req #75121 [NEW]: PHP cuts out charset information from content-type in file uploads

From: Date: Fri, 25 Aug 2017 15:12:24 +0000
Subject: Req #75121 [NEW]: PHP cuts out charset information from content-type in file uploads
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-210811@lists.php.net to get a copy of this message
From: jocrutrisi at ibsats dot com Operating system: All PHP version: 7.2.0beta3 Package: Unknown/Other Function Bug Type: Feature/Change Request Bug description:PHP cuts out charset information from content-type in file uploads 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 bug report at https://bugs.php.net/bug.php?id=75121&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75121&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75121&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75121&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=75121&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=75121&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=75121&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=75121&r=needscript Try newer version: https://bugs.php.net/fix.php?id=75121&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=75121&r=support Expected behavior: https://bugs.php.net/fix.php?id=75121&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=75121&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=75121&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=75121&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75121&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=75121&r=dst IIS Stability: https://bugs.php.net/fix.php?id=75121&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=75121&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=75121&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=75121&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=75121&r=mysqlcfg

« previous php.bugs (#210811) next »