From: robsiemb Date: Thu, 19 Dec 2002 19:27:20 +0000 (+0000) Subject: 3 minor bugs: X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=27dd7a0c246c639c0f735cfe7831bcd61b639e4c;p=squirrelmail.git 3 minor bugs: * If we don't get a $msg back in parseStructure, don't call $msg->setEntIds. * NIL can be 'NIL ' or 'NIL)' * Literal sizes DO NOT include the \r\n in their counts. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4283 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/class/mime/Message.class.php b/class/mime/Message.class.php index 9cce1046..b3fb64c2 100644 --- a/class/mime/Message.class.php +++ b/class/mime/Message.class.php @@ -138,7 +138,7 @@ class Message { */ function parseStructure($read, &$i, $sub_msg = '') { $msg = Message::parseBodyStructure($read, $i, $sub_msg); - $msg->setEntIds($msg,false,0); + if($msg) $msg->setEntIds($msg,false,0); return $msg; } @@ -279,7 +279,8 @@ class Message { case 'n': case 'N': /* probably NIL argument */ - if (strtoupper(substr($read, $i, 4)) == 'NIL ') { + $tmpnil = strtoupper(substr($read, $i, 4)); + if ($tmpnil == 'NIL ' || $tmpnil == 'NIL)') { $arg_a[] = ''; ++$arg_no; $i += 2; @@ -458,8 +459,8 @@ class Message { $iPos = strpos($read,'}',$i); if ($iPos) { $lit_cnt = substr($read, $i, $iPos - $i); - $i += strlen($lit_cnt) + 3; /* } + \r + \n */ - $lit_cnt -= 2; /* lit_cnt includes \r\n */ + $i += strlen($lit_cnt) + 3; /* skip } + \r + \n */ + /* Now read the literal */ $s = ($lit_cnt ? substr($read,$i,$lit_cnt): ''); $i += $lit_cnt; } else { /* should never happen */