From a171b3591163cb893aa084582fa2a1fc76676dcd Mon Sep 17 00:00:00 2001 From: stekkel Date: Thu, 5 Sep 2002 17:34:27 +0000 Subject: [PATCH] previous cleanup broke the find_ent_id function git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3568 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mime.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/functions/mime.php b/functions/mime.php index 44505299..d2e88463 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -622,17 +622,15 @@ function encodeHeader ($string) { } /* This function trys to locate the entity_id of a specific mime element */ - function find_ent_id($id, $message) { - $ret = ''; - for ($i = 0; $ret == '' && $i < count($message->entities); $i++) { - if ($message->entities[$i]->header->type0 != 'multipart') { + for ($i = 0, $ret = ''; $ret == '' && $i < count($message->entities); $i++) { + if ($message->entities[$i]->header->type0 == 'multipart') { $ret = find_ent_id($id, $message->entities[$i]); } else { if (strcasecmp($message->entities[$i]->header->id, $id) == 0) { if (sq_check_save_extension($message->entities[$i])) { - $ret = $message->entities[$i]->entity_id; - } + return $message->entities[$i]->entity_id; + } } } } -- 2.25.1