diff options
author | Thomas Bruederli <thomas@roundcube.net> | 2012-11-17 16:24:09 +0100 |
---|---|---|
committer | Thomas Bruederli <thomas@roundcube.net> | 2012-11-17 16:24:09 +0100 |
commit | 6ddb16d181e285d4f0ef0ef55bdd0ba787f1b583 (patch) | |
tree | 5f186f89d5d7f77592acf3aec676b48367a96d48 /program/include/rcube_message.php | |
parent | bc66f7d6d208ac99dcec57992c4eb955570d85bc (diff) | |
parent | 9ab34604d94270f6c1795c7dd7b615273d05db0c (diff) |
Merge branch 'master' of github.com:roundcube/roundcubemail
Diffstat (limited to 'program/include/rcube_message.php')
-rw-r--r-- | program/include/rcube_message.php | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/program/include/rcube_message.php b/program/include/rcube_message.php index 47aa4493e..87319f04f 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 @@ class rcube_message * 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); @@ -270,10 +272,6 @@ class rcube_message 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); return $txt->get_text(); |