Fix message highlighting for mailbox changes
authorindiri69 <indiri69@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 21 May 2004 15:26:38 +0000 (15:26 +0000)
committerindiri69 <indiri69@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 21 May 2004 15:26:38 +0000 (15:26 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7510 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mailbox_display.php

index 17660ac2a177d7e2fcb9e6b28b10edb4e122d567..66d80ed8a7932148604f81e3b816f28ecb5d794d 100644 (file)
@@ -212,6 +212,7 @@ function printMessageInfo($t, $last=false, $msg, $mailbox,
         $searchstr = '';
     }
 
+    $matches = array('TO' => 'sTo', 'CC' => 'sCc', 'FROM' => 'sFrom', 'SUBJECT' => 'sSubject');
     if (is_array($message_highlight_list) && count($message_highlight_list)) {
         $sTo = parseAddress($sTo);
         $sCc = parseAddress($sCc);
@@ -229,7 +230,7 @@ function printMessageInfo($t, $last=false, $msg, $mailbox,
                         case('TO'):
                         case('CC'):
                         case('FROM'):
-                            foreach ($msg[$match_type] as $address) {
+                            foreach ($$matches[$match_type] as $address) {
                                 $address[0] = decodeHeader($address[0], true, false);
                                 $address[1] = decodeHeader($address[1], true, false);
                                 if (strstr('^^' . strtolower($address[0]), $high_val) ||
@@ -240,7 +241,7 @@ function printMessageInfo($t, $last=false, $msg, $mailbox,
                             }
                             break;
                         default:
-                            $headertest = strtolower(decodeHeader($msg[$match_type], true, false));
+                            $headertest = strtolower(decodeHeader($$matches[$match_type], true, false));
                             if (strstr('^^' . $headertest, $high_val)) {
                                 $hlt_color = $message_highlight_list_part['color'];
                                 break 3;