X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=class%2Fmime%2FMessage.class.php;h=68e88dd7f15f06e22f77b88d8797d72820300df2;hp=b6d0f221ecd593da2edfea57ed45c901540a4230;hb=b65a57eafe670d1550f663704ec100a5fe719bef;hpb=ace33b58d2b4d8266e1dc66d1bbe54074eb01a70 diff --git a/class/mime/Message.class.php b/class/mime/Message.class.php index b6d0f221..68e88dd7 100644 --- a/class/mime/Message.class.php +++ b/class/mime/Message.class.php @@ -5,7 +5,7 @@ * * This file contains functions needed to handle mime messages. * - * @copyright 2003-2010 The SquirrelMail Project Team + * @copyright 2003-2018 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail @@ -292,7 +292,7 @@ class Message { * @return object Message object * @todo define argument and return types */ - function parseStructure($read, &$i, $sub_msg = '') { + static function parseStructure($read, &$i, $sub_msg = '') { $msg = Message::parseBodyStructure($read, $i, $sub_msg); if($msg) $msg->setEntIds($msg,false,0); return $msg; @@ -342,7 +342,7 @@ class Message { * @todo document me * @since 1.4.0 (code was part of parseStructure() in 1.3.x) */ - function parseBodyStructure($read, &$i, $sub_msg = '') { + static function parseBodyStructure($read, &$i, $sub_msg = '') { $arg_no = 0; $arg_a = array(); if ($sub_msg) { @@ -363,6 +363,7 @@ class Message { $hdr->type0 = 'text'; $hdr->type1 = 'plain'; $hdr->encoding = '7bit'; + $msg->header = $hdr; } else { $msg->header->type0 = 'multipart'; $msg->type0 = 'multipart'; @@ -461,17 +462,17 @@ class Message { $arg_a[] = $msg->parseLiteral($read, $i); ++$arg_no; break; - case '0': + case '0': case is_numeric($read{$i}): /* process integers */ if ($read{$i} == ' ') { break; } - ++$arg_no; - if (preg_match('/^([0-9]+).*/',substr($read,$i), $regs)) { - $i += strlen($regs[1])-1; - $arg_a[] = $regs[1]; - } else { - $arg_a[] = 0; - } + ++$arg_no; + if (preg_match('/^([0-9]+).*/',substr($read,$i), $regs)) { + $i += strlen($regs[1])-1; + $arg_a[] = $regs[1]; + } else { + $arg_a[] = 0; + } break; case ')': $multipart = (isset($msg->type0) && ($msg->type0 == 'multipart'));