From 80b4debd1dafcedd50ba876abb246d73ce1f5b62 Mon Sep 17 00:00:00 2001 From: stekkel Date: Tue, 21 Oct 2003 19:00:35 +0000 Subject: [PATCH] Fix for Outlook html mail with a defined background color and no text color. When the default text color is white (that happens with some themes) then you will see nothing. This fix set the text color to black. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5997 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mime.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/functions/mime.php b/functions/mime.php index e8538eb9..9f7692b0 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -1518,6 +1518,7 @@ function sq_body2div($attary, $mailbox, $message, $id){ $divattary = Array('class' => "'bodyclass'"); $bgcolor = '#ffffff'; $text = '#000000'; + $has_bgc_stl = $has_txt_stl = false; $styledef = ''; if (is_array($attary) && sizeof($attary) > 0){ foreach ($attary as $attname=>$attvalue){ @@ -1530,13 +1531,20 @@ function sq_body2div($attary, $mailbox, $message, $id){ $styledef .= "background-image: url('$attvalue'); "; break; case 'bgcolor': + $has_bgc_stl = true; $styledef .= "background-color: $attvalue; "; break; case 'text': + $has_txt_stl = true; $styledef .= "color: $attvalue; "; break; } } + // Outlook defines a white bgcolor and no text color. This can lead to + // white text on a white bg with certain themes. + if ($has_bgc_stl && !$has_txt_stl) { + $styledef .= "color: $text; "; + } if (strlen($styledef) > 0){ $divattary{"style"} = "\"$styledef\""; } -- 2.25.1