fixed some more quoting problems with searching and message highlighting
[squirrelmail.git] / functions / mailbox_display.php
index 2a85413642b930c2da511fc50b419b7d9fc517a9..0b67db0cf17ffb3a4879e0113cde938adbf31ff4 100644 (file)
                if ($mailbox == $sent_folder) { $italic = "<i>"; $italic_end = "</i>"; }
       
       for ($i=0; $i < count($message_highlight_list); $i++) {
-         if ($message_highlight_list[$i]["match_type"] == "to_cc") {
-            if (eregi($message_highlight_list[$i]["value"],$msg["TO"]) || eregi($message_highlight_list[$i]["value"],$msg["CC"])) {
+         if (trim($message_highlight_list[$i]["value"]) != "") {
+            if ($message_highlight_list[$i]["match_type"] == "to_cc") {
+               if (strpos("^^".$msg["TO"], $message_highlight_list[$i]["value"]) || strpos("^^".$msg["CC"], $message_highlight_list[$i]["value"])) {
+                  $hlt_color = $message_highlight_list[$i]["color"];
+                  continue;
+               }
+            } else if (strpos("^^".$msg[strtoupper($message_highlight_list[$i]["match_type"])],$message_highlight_list[$i]["value"])) {
                $hlt_color = $message_highlight_list[$i]["color"];
                continue;
-            }
-         } else if (eregi($message_highlight_list[$i]["value"],$msg[strtoupper($message_highlight_list[$i]["match_type"])])) {
-            $hlt_color = $message_highlight_list[$i]["color"];
-            continue;
-         }   
+            }   
+         }
       }   
       
       if (!$hlt_color)