summaryrefslogtreecommitdiff
path: root/program/include/rcube_imap.php
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-11-24 14:51:43 +0000
committeralecpl <alec@alec.pl>2011-11-24 14:51:43 +0000
commite4a4ca19480690193e36e14ef6b9d592e73e9e9c (patch)
treeb24656462bb2ffc33cf2504dd84e571d798d677e /program/include/rcube_imap.php
parent3875eb68139d878fba2f00bdcaae3c34ebb53da7 (diff)
- Performance improvements
Diffstat (limited to 'program/include/rcube_imap.php')
-rw-r--r--program/include/rcube_imap.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index a0a5f8189..50656f28c 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -2416,10 +2416,12 @@ class rcube_imap
// convert charset (if text or message part)
if ($body && preg_match('/^(text|message)$/', $o_part->ctype_primary)) {
- // Remove NULL characters (#1486189)
- $body = str_replace("\x00", '', $body);
+ // Remove NULL characters if any (#1486189)
+ if (strpos($body, "\x00") !== false) {
+ $body = str_replace("\x00", '', $body);
+ }
- if (!$skip_charset_conv) {
+ if (!$skip_charset_conv) {
if (!$o_part->charset || strtoupper($o_part->charset) == 'US-ASCII') {
// try to extract charset information from HTML meta tag (#1488125)
if ($o_part->ctype_secondary == 'html' && preg_match('/<meta[^>]+charset=([a-z0-9-_]+)/i', $body, $m))