projects
/
squirrelmail.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix for Outlook html mail with a defined background color and no text color.
[squirrelmail.git]
/
functions
/
mime.php
diff --git
a/functions/mime.php
b/functions/mime.php
index e8538eb918fb79c9ed0427c72edbc271742ee85a..9f7692b09e54c474cf86b789c433c9c4e302d1ad 100644
(file)
--- 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';
$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){
$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':
$styledef .= "background-image: url('$attvalue'); ";
break;
case 'bgcolor':
+ $has_bgc_stl = true;
$styledef .= "background-color: $attvalue; ";
break;
case 'text':
$styledef .= "background-color: $attvalue; ";
break;
case 'text':
+ $has_txt_stl = true;
$styledef .= "color: $attvalue; ";
break;
}
}
$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\"";
}
if (strlen($styledef) > 0){
$divattary{"style"} = "\"$styledef\"";
}