From be9aacaa5296dfca63fb3a01c2dc52538d1546aa Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Sat, 17 Nov 2012 12:31:31 -0500
Subject: [PATCH] Bring back lost localization for the about page

---
 program/include/rcube_message.php |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/program/include/rcube_message.php b/program/include/rcube_message.php
index 38d1817..87319f0 100644
--- a/program/include/rcube_message.php
+++ b/program/include/rcube_message.php
@@ -24,7 +24,8 @@
  * Logical representation of a mail message with all its data
  * and related functions
  *
- * @package    Mail
+ * @package    Framework
+ * @subpackage Storage
  * @author     Thomas Bruederli <roundcube@gmail.com>
  */
 class rcube_message
@@ -198,14 +199,15 @@
      * Determine if the message contains a HTML part
      *
      * @param bool $recursive Enables checking in all levels of the structure
+     * @param bool $enriched  Enables checking for text/enriched parts too
      *
      * @return bool True if a HTML is available, False if not
      */
-    function has_html_part($recursive = true)
+    function has_html_part($recursive = true, $enriched = false)
     {
         // check all message parts
         foreach ($this->parts as $part) {
-            if ($part->mimetype == 'text/html') {
+            if ($part->mimetype == 'text/html' || ($enriched && $part->mimetype == 'text/enriched')) {
                 // Level check, we'll skip e.g. HTML attachments
                 if (!$recursive) {
                     $level = explode('.', $part->mime_id);
@@ -269,10 +271,6 @@
             }
             else if ($part->mimetype == 'text/html') {
                 $out = $this->get_part_content($mime_id);
-
-                // remove special chars encoding
-                $trans = array_flip(get_html_translation_table(HTML_ENTITIES));
-                $out = strtr($out, $trans);
 
                 // create instance of html2text class
                 $txt = new html2text($out);
@@ -483,7 +481,7 @@
                     if ($plugin['abort'])
                         continue;
 
-                    if ($part_mimetype == 'text/html') {
+                    if ($part_mimetype == 'text/html' && $mail_part->size) {
                         $got_html_part = true;
                     }
 

--
Gitblit v1.9.1