From 5587b34cfa5d04fec8e009288cabd0ffdbf39413 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Wed, 30 Nov 2011 06:05:50 -0500
Subject: [PATCH] Enable buttons having an inner <span> for better CSS styling capabilities

---
 program/include/rcube_imap.php |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index 002730f..50656f2 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -2416,10 +2416,12 @@
 
         // 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))
@@ -3178,7 +3180,7 @@
                 if (is_array($ns)) {
                     foreach ($ns as $ns_data) {
                         if (strlen($ns_data[0])) {
-                            $search = $ns_data[0];
+                            $search[] = $ns_data[0];
                         }
                     }
                 }

--
Gitblit v1.9.1