fix for getEntity
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 30 Aug 2002 15:05:33 +0000 (15:05 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 30 Aug 2002 15:05:33 +0000 (15:05 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3512 7612ce4b-ef26-0410-bec9-ea0150e637f0

class/mime/Message.class.php

index cc12be4dbe9550111a63932a25433909ecfed814..97b9966e068aa0785e5ae2780fb0fc48e63ecf11 100644 (file)
@@ -70,9 +70,8 @@ class Message {
             $cur_ent_a = explode('.', $this->entity_id);
         }
         $ent_a = explode('.', $ent);
-
-        $entCount = count($ent_a) - 1;
-        for ($i = 0; $i < $entCount; ++$i) {
+        
+        for ($i = 0,$entCount = count($ent_a) - 1; $i < $entCount; ++$i) {
             if (isset($cur_ent_a[$i]) && ($cur_ent_a[$i] != $ent_a[$i])) {
                 $msg = $msg->parent;
                 $cur_ent_a = explode('.', $msg->entity_id);
@@ -95,9 +94,9 @@ class Message {
             $msg = $msg->entities[0];
         }
 
-        if (isset($msg->entities[($ent_a[$cnt])-1])) {
-            if (is_object($msg->entities[($ent_a[$cnt])-1])) {
-                $msg = $msg->entities[($ent_a[$cnt]-1)];
+        if (isset($msg->entities[($ent_a[$entCount])-1])) {
+            if (is_object($msg->entities[($ent_a[$entCount])-1])) {
+                $msg = $msg->entities[($ent_a[$entCount]-1)];
             }
         }