Use $mime_parts not $parts in has_*_part() methods so detection is

correct no matter if prefer_html is enabled or not.
pull/62/head
Aleksander Machniak 12 years ago
parent 542f15bfec
commit 574928200f

@ -206,7 +206,7 @@ class rcube_message
function has_html_part($enriched = false) function has_html_part($enriched = false)
{ {
// check all message parts // check all message parts
foreach ($this->parts as $part) { foreach ($this->mime_parts as $part) {
if ($part->mimetype == 'text/html' || ($enriched && $part->mimetype == 'text/enriched')) { if ($part->mimetype == 'text/html' || ($enriched && $part->mimetype == 'text/enriched')) {
// Skip if part is an attachment // Skip if part is an attachment
if ($this->is_attachment($part)) { if ($this->is_attachment($part)) {
@ -246,7 +246,7 @@ class rcube_message
function has_text_part() function has_text_part()
{ {
// check all message parts // check all message parts
foreach ($this->parts as $part) { foreach ($this->mime_parts as $part) {
if ($part->mimetype == 'text/plain') { if ($part->mimetype == 'text/plain') {
// Skip if part is an attachment // Skip if part is an attachment
if ($this->is_attachment($part)) { if ($this->is_attachment($part)) {

Loading…
Cancel
Save