From 05c7f8f25717f00092f5159d30f563652a83e335 Mon Sep 17 00:00:00 2001 From: fidian Date: Fri, 23 Nov 2001 15:00:03 +0000 Subject: [PATCH] Added slightly better font colors. Problem: White background on table made text very unreadable with the default text color being white (I use the black bean burrito theme). Adding the font tag starts to help. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1791 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mime.php | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/functions/mime.php b/functions/mime.php index a790fb20..e95246e7 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -822,13 +822,23 @@ $j = strlen( $body ); // Legnth of the HTML $ret = ''; // Returned string $bgcolor = '#ffffff'; // Background style color (defaults to white) + $textcolor = '#000000'; // Foreground style color (defaults to black) $leftmargin = ''; // Left margin style $title = ''; // HTML title if any $i = 0; while( $i < $j ) { if( $body{$i} == '<' ) { - $tag = $body{$i+1}.$body{$i+2}.$body{$i+3}.$body{$i+4}; + $pos = $i + 1; + $tag = ''; + while ($body{$pos} == ' ' || $body{$pos} == "\t" || + $body{$pos} == "\n") + $pos ++; + while (strlen($tag) < 4 && $body{$pos} != ' ' && + $body{$pos} != "\t" && $body{$pos} != "\n") { + $tag .= $body{$pos}; + $pos ++; + } switch( strtoupper( $tag ) ) { // Strips the entire tag and contents case 'APPL': @@ -936,13 +946,14 @@ $i += 5; if (! isset($base)) $base = ''; - $ret .= stripEvent( $i, $j, $body, $id, $base ); - //if( $bgcolor <> '' ) - $ret .= " bgcolor=$bgcolor"; - $ret .= ' width=100%>'; + $ret .= stripEvent( $i, $j, $body, $id, $base ); + $ret .= " bgcolor=$bgcolor width=100%>"; if( $leftmargin <> '' ) $ret .= " "; $ret .= ''; + if (strtolower($bgcolor) == 'ffffff' || + strtolower($bgcolor) == '#ffffff') + $ret .= ''; break; case 'BASE': $i += 5; @@ -967,7 +978,7 @@ } break; case '/BOD': - $ret .= ''; + $ret .= ''; $i += 6; break; default: -- 2.25.1