From 2da8300fb7bb7b0a386d334d4c82a2ffbe3d9331 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Sun, 26 Oct 2014 04:34:24 -0400
Subject: [PATCH] Correctly detect charset of attachment names in TNEF messages
---
program/lib/Roundcube/rcube_imap_cache.php | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/program/lib/Roundcube/rcube_imap_cache.php b/program/lib/Roundcube/rcube_imap_cache.php
index 95498e3..81df076 100644
--- a/program/lib/Roundcube/rcube_imap_cache.php
+++ b/program/lib/Roundcube/rcube_imap_cache.php
@@ -1245,13 +1245,15 @@
private function message_object_prepare(&$msg, &$size = 0)
{
// Remove body too big
- if ($msg->body && ($length = strlen($msg->body))) {
- $size += $length;
+ if (isset($msg->body)) {
+ $length = strlen($msg->body);
- if ($size > $this->threshold * 1024) {
- $size -= $length;
+ if ($msg->body_modified || $size + $length > $this->threshold * 1024) {
unset($msg->body);
}
+ else {
+ $size += $length;
+ }
}
// Fix mimetype which might be broken by some code when message is displayed
--
Gitblit v1.9.1