#2996 [Opn->]: mime.c not parsing MIME headers properly
| From: | sniper@php.net | Date: | Wed, 30 Mar 2005 07:01:53 +0000 |
| Subject: | #2996 [Opn->]: mime.c not parsing MIME headers properly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-76029@lists.php.net to get a copy of this message | ||
ID: 2996
Updated by: sniper@php.net
Reported By: jeddings at jeddings dot com
-Status: Open
+Status: Wont Fix
Bug Type: Parser error
Operating System: Linux 2.2.5-15
PHP Version: 3.0.12
Assigned To: hholzgra
New Comment:
We are sorry, but we can not support PHP 3 related problems anymore.
Momentum is gathering for PHP 5, and we think supporting PHP 3 will
lead to a waste of resources which we want to put into getting PHP 5
ready. Of course PHP 4 will continue to be supported for the
forseeable future.
Previous Comments:
------------------------------------------------------------------------
[1999-12-21 08:55:11] jeddings at jeddings dot com
There is some question as to whether Content-Length is a valid header,
since the RFC is not clear. There needs to be clarification on this.
------------------------------------------------------------------------
[1999-12-18 04:48:26] jeddings at jeddings dot com
I'm using Perl's LWP and HTTP::Request::Common modules to POST a
multipart/form-data form to upload a file to an Apache 1.3.6/PHP 3.0.12
web server.
The problem comes when PHP goes to MIME unencode the POST. mime.c's
php3_mime_split function looks for one of four things to be in the
POST: the boundary, the Content-Disposition header, a plain form-data
field, or the uploaded file field (with a Content-Type header). But
Perl's HTTP::Request::Common puts in an additional header:
Content-Length.
According to the RFC (RFC 1867), this seems legal. So when Perl
sends:
Content-type: multipart/form-data, boundary=AaB03x
--AaB03x
Content-Disposition: form-data; name="field1"
Joe Perl
--AaB03x
Content-Disposition: form-data; name="uploadfile";
filename="file1.txt"
Content-Length: 5660
Content-Type: text/plain
... contents of file1.txt ...
--AaB03x--
php3_mime_split saves the $uploadfile starting with "ntent-type:
text/plain..." rather than the correct spot, which would be after the
single \n by itself.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=2996&edit=1