From: Michael M Slusarz Date: Wed, 1 Jul 2009 18:25:00 +0000 (-0600) Subject: Fix multipart size determination X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=4cef9745b972db61129bde1cc728a02bd3ca7dce;p=horde.git Fix multipart size determination --- diff --git a/framework/Mime/lib/Horde/Mime/Part.php b/framework/Mime/lib/Horde/Mime/Part.php index 6709394b7..41934a5ff 100644 --- a/framework/Mime/lib/Horde/Mime/Part.php +++ b/framework/Mime/lib/Horde/Mime/Part.php @@ -170,7 +170,7 @@ class Horde_Mime_Part * * @var integer */ - protected $_bytes = 0; + protected $_bytes; /** * The content-ID for this part. @@ -1150,17 +1150,13 @@ class Horde_Mime_Part */ public function getBytes() { - if (empty($this->_contents)) { - $bytes = $this->_bytes ? $this->_bytes : 0; + if (isset($this->_bytes)) { + $bytes = $this->_bytes; } elseif ($this->getPrimaryType() == 'multipart') { $bytes = 0; reset($this->_parts); while (list(,$part) = each($this->_parts)) { - /* Skip multipart entries (since this may result in double - counting). */ - if ($part->getPrimaryType() != 'multipart') { - $bytes += $part->getBytes(); - } + $bytes += $part->getBytes(); } } else { fseek($this->_contents, 0, SEEK_END);