Bug #2996: mime.c not parsing MIME headers properly

From: Date: Sat, 18 Dec 1999 09:48:27 +0000
Subject: Bug #2996: mime.c not parsing MIME headers properly
Groups: php.dev 
Request: Send a blank email to php-dev+get-13818@lists.php.net to get a copy of this message
From: jeddings@jeddings.com Operating system: Linux 2.2.5-15 PHP version: 3.0.12 PHP Bug Type: Parser error Bug description: mime.c not parsing MIME headers properly 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.

« previous php.dev (#13818) next »