Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.6

Bug #7676 Content-Type decoding isn't compliant with RFC 2045
Submitted: 2006-05-20 02:22 UTC
From: priappub at yahoo dot fr Assigned:
Status: No Feedback Package: Mail_mimeDecode (version 1.3.1)
PHP Version: 5.1.4 OS: ALL
Roadmaps: (Not assigned)    
Subscription  
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes. If this is not your bug, you can add a comment by following this link. If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
2012-01-27 19:49 UTC
Package:
Bug Type:
Summary:
From: priappub at yahoo dot fr
New email:
PHP Version: Package Version: OS:

 

 [2006-05-20 02:22 UTC] priappub at yahoo dot fr (PRIAP)
Description: ------------ The RFC 2045 says: "Default RFC 822 messages without a MIME Content-Type header are taken by this protocol to be plain text in the US-ASCII character set, which can be explicitly specified as: Content-type: text/plain; charset=us-ascii This default is assumed if no Content-Type header field is specified. It is also recommend that this default be assumed when a syntactically invalid Content-Type header field is encountered." In function _decode, if there is no Content-Type, it's OK, we have: $ctype = explode('/', $default_ctype); $return->ctype_primary = $ctype[0]; $return->ctype_secondary = $ctype[1]; But if we have "Content-Type: text" which is not RFC compliant, we haven't this piece of code and ctype_secondary isn't defined.

Comments

 [2006-05-20 02:56 UTC] priappub at yahoo dot fr
The RFC 2045 says: "Default RFC 822 messages without a MIME Content-Type header are taken by this protocol to be plain text in the US-ASCII character set, which can be explicitly specified as: Content-type: text/plain; charset=us-ascii This default is assumed if no Content-Type header field is specified. It is also recommend that this default be assumed when a syntactically invalid Content-Type header field is encountered." In function _decode, if there is no Content-Type, it's OK, we have: $ctype = explode('/', $default_ctype); $return->ctype_primary = $ctype[0]; $return->ctype_secondary = $ctype[1]; But if we have for exemple "Content-Type: text" which is not RFC compliant, we haven't this piece of code. ctype_primary and ctype_secondary are not defined. I suggest on line 318: default: $ctype = explode('/', $default_ctype); $return->ctype_primary = $ctype[0]; $return->ctype_secondary = $ctype[1]; ...
 [2006-05-20 03:09 UTC] priappub at yahoo dot fr
I have no brain, it's on line 245: if (preg_match('/([0-9a-z+.-]+)\/([0-9a-z+.-]+)/i', $content_type['value'], $regs)) { $return->ctype_primary = $regs[1]; $return->ctype_secondary = $regs[2]; } // Content type != type "/" subtype else { $ctype = explode('/', $default_ctype); $return->ctype_primary = $ctype[0]; $return->ctype_secondary = $ctype[1]; } ...
 [2010-09-02 16:56 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2012-01-27 19:49 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!