Changed the way we handle entities in message/rfc822 types. $msg->entity_id++
authorindiri69 <indiri69@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 26 Aug 2002 22:13:56 +0000 (22:13 +0000)
committerindiri69 <indiri69@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 26 Aug 2002 22:13:56 +0000 (22:13 +0000)
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

index 91eec967dbbb8fa9cb2e0daea32938558c27e349..f6ae0d74c328a68d674ef0c5b5e1f344064837e7 100644 (file)
@@ -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 */