More code cleanups
authorindiri69 <indiri69@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 9 Oct 2002 16:59:56 +0000 (16:59 +0000)
committerindiri69 <indiri69@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 9 Oct 2002 16:59:56 +0000 (16:59 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3824 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mailbox_display.php

index 83097cad4c398180f024e922f0b5b002bc411822..5caf500bc9bbff470ac8589228875c1893084940 100644 (file)
@@ -121,17 +121,16 @@ function printMessageInfo($imapConnection, $t, $i, $key, $mailbox,
     if (sizeof($message_highlight_list)){
         foreach ($message_highlight_list as $message_highlight_list_part) {
             if (trim($message_highlight_list_part['value']) != '') {
-                if ($message_highlight_list_part['match_type'] == 'to_cc') {
-                    if (strstr('^^' . strtolower($msg['TO']),
-                               strtolower($message_highlight_list_part['value']))
-                        || strstr('^^'.strtolower($msg['CC']),
-                                  strtolower($message_highlight_list_part['value']))) {
+                $high_val   = strtolower($message_highlight_list_part['value']);
+                $match_type = strtoupper($message_highlight_list_part['match_type']);
+                if ($match_type == 'TO_CC') {
+                    if (strstr('^^' . strtolower($msg['TO']), $high_val) ||
+                        strstr('^^' . strtolower($msg['CC']), $high_val)) {
                         $hlt_color = $message_highlight_list_part['color'];
                         continue;
                     }
                 } else {
-                    if (strstr('^^' . strtolower($msg[strtoupper($message_highlight_list_part['match_type'])]),
-                               strtolower($message_highlight_list_part['value']))) {
+                    if (strstr('^^' . strtolower($msg[$match_type]), $high_val)) {
                         $hlt_color = $message_highlight_list_part['color'];
                         continue;
                     }
@@ -623,7 +622,7 @@ function displayMessageArray($imapConnection, $num_msgs, $start_msg,
             $k++;
         } while (isset ($key) && ($k < $i));
         printMessageInfo($imapConnection, $t, $i, $key, $mailbox,
-            $real_startMessage, $where, $what);
+                         $real_startMessage, $where, $what);
     } else {
         $i = $start_msg;
         reset($msort);