From 9701e9c8f0b83b9c515d9416dc3e43577db3e834 Mon Sep 17 00:00:00 2001 From: indiri69 Date: Fri, 11 Jul 2003 17:51:34 +0000 Subject: [PATCH] Fix message highlighting for text with spaces in it. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5264 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mailbox_display.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 4fd3b5fa..12480fb2 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -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(' ',' ',$senderName); - $msg['SUBJECT'] = decodeHeader($msg['SUBJECT']); - $subject = processSubject($msg['SUBJECT'], $indent_array[$msg['ID']]); - $subject = str_replace(' ',' ',$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(' ',' ',$subject); if (sizeof($index_order)) { foreach ($index_order as $index_order_part) { switch ($index_order_part) { -- 2.25.1