Bug #2181: imap_fetchstructure() don't set body->type when message is TYPETEXT
| From: | tsukada at fminn dot nagano dot nagano dot jp | Date: | Sat, 28 Aug 1999 15:42:39 +0000 |
| Subject: | Bug #2181: imap_fetchstructure() don't set body->type when message is TYPETEXT | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-10296@lists.php.net to get a copy of this message | ||
From: tsukada@fminn.nagano.nagano.jp
Operating system: Linux RH6.0
PHP version: 3.0 Latest CVS (28/08/1999)
PHP Bug Type: Misbehaving function
Bug description: imap_fetchstructure() don't set body->type when message is TYPETEXT
please check below patch
--- imap.c.orig Sat Aug 28 23:43:06 1999
+++ imap.c Sun Aug 29 00:08:24 1999
@@ -2087,8 +2087,8 @@
PARAMETER *par, *dpar;
PART *part;
- if(body->type) add_property_long( arg, "type", body->type );
- if(body->encoding) add_property_long( arg, "encoding", body->encoding );
+ if(body->type < TYPEMAX) add_property_long( arg, "type", body->type );
+ if(body->encoding < ENCMAX) add_property_long( arg, "encoding",
body->encoding );
if ( body->subtype ){
add_property_long( arg, "ifsubtype", 1 );
@@ -2711,8 +2711,8 @@
}
body=mail_body(imap_le_struct->imap_stream, msg->value.lval,
section->value.str.val);
- if(body->type) add_property_long( return_value, "type", body->type );
- if(body->encoding) add_property_long( return_value, "encoding",
body->encoding );
+ if(body->type < TYPEMAX) add_property_long( return_value, "type",
body->type );
+ if(body->encoding < ENCMAX) add_property_long( return_value, "encoding",
body->encoding );
if ( body->subtype ){
add_property_long( return_value, "ifsubtype", 1 );