[Hastymail-cvs] SF.net SVN: hastymail:[1115] trunk/hastymail2/lib/url_action_classes/ message.php
Brought to you by:
sailfrog,
slushpupie
From: <sai...@us...> - 2009-10-28 17:24:02
|
Revision: 1115 http://hastymail.svn.sourceforge.net/hastymail/?rev=1115&view=rev Author: sailfrog Date: 2009-10-28 17:23:51 +0000 (Wed, 28 Oct 2009) Log Message: ----------- fix a bug in the message part download routine that can cause extra data in the downloaded file Modified Paths: -------------- trunk/hastymail2/lib/url_action_classes/message.php Modified: trunk/hastymail2/lib/url_action_classes/message.php =================================================================== --- trunk/hastymail2/lib/url_action_classes/message.php 2009-10-28 15:32:45 UTC (rev 1114) +++ trunk/hastymail2/lib/url_action_classes/message.php 2009-10-28 17:23:51 UTC (rev 1115) @@ -346,14 +346,18 @@ while ($data = $imap->get_message_part_line()) { $read_size += strlen($data); if ($read_size > $lit_size) { - if (substr($data, -3, 1) == ')') { - $data = substr($data, 0, -3); + $extra = $read_size - $lit_size; + if (strlen($data) > $extra) { + $data = substr($data, 0, (strlen($data) - $extra)); } + else { + $data = false; + } } - if ($encoding == 'base64_decode') { + if ($data && $encoding == 'base64_decode') { $data = base64_decode($data); } - elseif ($encoding == 'quoted_decode') { + elseif ($data && $encoding == 'quoted_decode') { $data = $user->user_action->quoted_decode($data); } if ($data) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |