Fix message highlighting for text with spaces in it.
authorindiri69 <indiri69@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 11 Jul 2003 17:51:34 +0000 (17:51 +0000)
committerindiri69 <indiri69@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 11 Jul 2003 17:51:34 +0000 (17:51 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5264 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mailbox_display.php

index 4fd3b5fa9a1ea708ce04703ef913f408146b93f3..12480fb208c2478706b1ee2d5cb6b56d20e1c66e 100644 (file)
@@ -74,7 +74,7 @@ function printMessageInfo($imapConnection, $t, $not_last=true, $key, $mailbox,
        $msg['FROM'] = $msg['TO'];
     }
     $msg['FROM'] = parseAddress($msg['FROM'],1);
-    
+
        /*
         * This is done in case you're looking into Sent folders,
         * because you can have multiple receivers.
@@ -95,9 +95,6 @@ function printMessageInfo($imapConnection, $t, $not_last=true, $key, $mailbox,
         }
     }
     $senderName = str_replace('&nbsp;',' ',$senderName);
-    $msg['SUBJECT'] = decodeHeader($msg['SUBJECT']);
-    $subject = processSubject($msg['SUBJECT'], $indent_array[$msg['ID']]);
-    $subject = str_replace('&nbsp;',' ',$subject);    
     echo html_tag( 'tr','','','','VALIGN="top"') . "\n";
 
     if (isset($msg['FLAG_FLAGGED']) && ($msg['FLAG_FLAGGED'] == true)) {
@@ -134,7 +131,7 @@ function printMessageInfo($imapConnection, $t, $not_last=true, $key, $mailbox,
     } else {
         $searchstr = '';
     }
-    
+
     if (is_array($message_highlight_list) && count($message_highlight_list)) {
         $msg['TO'] = parseAddress($msg['TO']);
         $msg['CC'] = parseAddress($msg['CC']);
@@ -153,8 +150,8 @@ function printMessageInfo($imapConnection, $t, $not_last=true, $key, $mailbox,
                         case('CC'):
                         case('FROM'):
                             foreach ($msg[$match_type] as $address) {
-                                $address[0] = decodeHeader($address[0]);
-                                $address[1] = decodeHeader($address[1]);
+                                $address[0] = decodeHeader($address[0], true, false);
+                                $address[1] = decodeHeader($address[1], true, false);
                                 if (strstr('^^' . strtolower($address[0]), $high_val) ||
                                     strstr('^^' . strtolower($address[1]), $high_val)) {
                                     $hlt_color = $message_highlight_list_part['color'];
@@ -163,7 +160,8 @@ function printMessageInfo($imapConnection, $t, $not_last=true, $key, $mailbox,
                             }
                             break;
                         default:
-                            if (strstr('^^' . strtolower($msg[$match_type]), $high_val)) {
+                            $headertest = strtolower(decodeHeader($msg[$match_type], true, false));
+                            if (strstr('^^' . $headertest, $high_val)) {
                                 $hlt_color = $message_highlight_list_part['color'];
                                 break 3; 
                             }
@@ -179,6 +177,9 @@ function printMessageInfo($imapConnection, $t, $not_last=true, $key, $mailbox,
     }
     $checked = ($checkall == 1) ? ' CHECKED' : '';
     $col = 0;
+    $msg['SUBJECT'] = decodeHeader($msg['SUBJECT']);
+    $subject = processSubject($msg['SUBJECT'], $indent_array[$msg['ID']]);
+    $subject = str_replace('&nbsp;',' ',$subject);    
     if (sizeof($index_order)) {
         foreach ($index_order as $index_order_part) {
             switch ($index_order_part) {