From 19ac8f6498d3fb6dd1e177f96518693b8f1b0b22 Mon Sep 17 00:00:00 2001 From: indiri69 Date: Mon, 26 Aug 2002 22:13:56 +0000 Subject: [PATCH] Changed the way we handle entities in message/rfc822 types. $msg->entity_id++ would increment by 0.1 in php 4.0.4 but would increment by 1.0 in php 4.0.6. This meant that a message/rfc822 type with only a text/plain part would label the text/plain part entity 3.0 instead of 2.1. This should fix that problem. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3469 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- class/mime.class.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/class/mime.class.php b/class/mime.class.php index 91eec967..f6ae0d74 100644 --- a/class/mime.class.php +++ b/class/mime.class.php @@ -854,10 +854,8 @@ class message { $hdr->disposition = (isset($arg_a[8+$s]) ? $arg_a[8+$s] : $hdr->disposition); $hdr->language = (isset($arg_a[9+$s]) ? $arg_a[9+$s] : $hdr->language); $msg->header = $hdr; -// $arg_no = 0; - ++$i; - if ((substr($msg->entity_id, -2) == '.0') && ($msg->type0 !='multipart')) { - $msg->entity_id++; + if ((strrchr($msg->entity_id, '.') == '.0') && ($msg->type0 !='multipart')) { + $msg->entity_id = $this->entity_id . '.1'; } } else { $hdr->type0 = 'multipart'; @@ -868,8 +866,8 @@ class message { $hdr->disposition = (isset($arg_a[2]) ? $arg_a[2] : $hdr->disposition); $hdr->language = (isset($arg_a[3]) ? $arg_a[3] : $hdr->language); $msg->header = $hdr; - ++$i; } + ++$i; return (array($msg, $i)); default: break; } /* switch */ -- 2.25.1