Bläddra i källkod

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.

Tyler Akins 23 år sedan
förälder
incheckning
f88991ffb3
1 ändrade filer med 17 tillägg och 6 borttagningar
  1. 17 6
      functions/mime.php

+ 17 - 6
functions/mime.php

@@ -822,13 +822,23 @@
         $j = strlen( $body );   // Legnth of the HTML
         $j = strlen( $body );   // Legnth of the HTML
         $ret = '';              // Returned string
         $ret = '';              // Returned string
         $bgcolor = '#ffffff';   // Background style color (defaults to white)
         $bgcolor = '#ffffff';   // Background style color (defaults to white)
+	$textcolor = '#000000'; // Foreground style color (defaults to black)
         $leftmargin = '';       // Left margin style
         $leftmargin = '';       // Left margin style
         $title = '';            // HTML title if any
         $title = '';            // HTML title if any
 
 
         $i = 0;
         $i = 0;
         while( $i < $j ) {
         while( $i < $j ) {
             if( $body{$i} == '<' ) {
             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 ) ) {
                 switch( strtoupper( $tag ) ) {
                     // Strips the entire tag and contents
                     // Strips the entire tag and contents
                     case 'APPL':
                     case 'APPL':
@@ -936,13 +946,14 @@
                         $i += 5;
                         $i += 5;
 			if (! isset($base))
 			if (! isset($base))
 			   $base = '';
 			   $base = '';
-                        $ret .= stripEvent( $i, $j, $body, $id, $base );
-                        //if( $bgcolor <> '' )
-                            $ret .= " bgcolor=$bgcolor";
-                        $ret .= ' width=100%><tr>';
+		        $ret .= stripEvent( $i, $j, $body, $id, $base );
+                        $ret .= " bgcolor=$bgcolor width=100%><tr>";
                         if( $leftmargin <> '' )
                         if( $leftmargin <> '' )
                             $ret .= "<td width=$leftmargin>&nbsp;</td>";
                             $ret .= "<td width=$leftmargin>&nbsp;</td>";
                         $ret .= '<td>';
                         $ret .= '<td>';
+			if (strtolower($bgcolor) == 'ffffff' || 
+			    strtolower($bgcolor) == '#ffffff')
+			   $ret .= '<font color=#000000>';
                         break;
                         break;
                     case 'BASE':
                     case 'BASE':
                         $i += 5;
                         $i += 5;
@@ -967,7 +978,7 @@
                         }
                         }
                         break;
                         break;
                     case '/BOD':
                     case '/BOD':
-                        $ret .= '</td></tr></TABLE>';
+                        $ret .= '</font></td></tr></TABLE>';
                         $i += 6;
                         $i += 6;
                         break;
                         break;
                     default:
                     default: