summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/rcube_imap.php
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2012-11-27 16:22:49 +0100
committerThomas Bruederli <thomas@roundcube.net>2012-11-27 16:22:49 +0100
commitdff2c713fbc5dd8a501a31f3c158b8be412f46d0 (patch)
treeda0e7fc83ee07c25858122669bbcd3d40c305b28 /program/lib/Roundcube/rcube_imap.php
parent0a83971d3e6bc5dae958e304bea4bb1e7a33db59 (diff)
Add argument to fetch message parts only partially. Can be used for content mimetype detection without loading the entire file
Diffstat (limited to 'program/lib/Roundcube/rcube_imap.php')
-rw-r--r--program/lib/Roundcube/rcube_imap.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php
index 9df2bf666..8ca24dec7 100644
--- a/program/lib/Roundcube/rcube_imap.php
+++ b/program/lib/Roundcube/rcube_imap.php
@@ -2051,10 +2051,11 @@ class rcube_imap extends rcube_storage
* @param mixed $print True to print part, ressource to write part contents in
* @param resource $fp File pointer to save the message part
* @param boolean $skip_charset_conv Disables charset conversion
+ * @param int $max_bytes Only read this number of bytes
*
* @return string Message/part body if not printed
*/
- public function get_message_part($uid, $part=1, $o_part=NULL, $print=NULL, $fp=NULL, $skip_charset_conv=false)
+ public function get_message_part($uid, $part=1, $o_part=NULL, $print=NULL, $fp=NULL, $skip_charset_conv=false, $max_bytes=0)
{
if (!$this->check_connection()) {
return null;
@@ -2074,7 +2075,7 @@ class rcube_imap extends rcube_storage
if ($o_part && $o_part->size) {
$body = $this->conn->handlePartBody($this->folder, $uid, true,
- $part ? $part : 'TEXT', $o_part->encoding, $print, $fp, $o_part->ctype_primary == 'text');
+ $part ? $part : 'TEXT', $o_part->encoding, $print, $fp, $o_part->ctype_primary == 'text', $max_bytes);
}
if ($fp || $print) {