Only in nasmail-1.6.1/config: config.php Only in nasmail-1.6.1/data: test.pref diff -ur nasmail-1.6.1.orig/functions/mailbox_display.php nasmail-1.6.1/functions/mailbox_display.php --- nasmail-1.6.1.orig/functions/mailbox_display.php 2008-05-26 19:21:56.000000000 +0300 +++ nasmail-1.6.1/functions/mailbox_display.php 2009-08-04 09:09:12.000000000 +0300 @@ -176,10 +176,10 @@ } if (is_array($message_highlight_list) && count($message_highlight_list)) { - $msg['TO'] = parseAddress($msg['TO']); - $msg['CC'] = parseAddress($msg['CC']); foreach ($message_highlight_list as $message_highlight_list_part) { - if (trim($message_highlight_list_part['value']) != '') { + if (trim($message_highlight_list_part['value']) != '' && + trim($message_highlight_list_part['color']) != '' && + trim($message_highlight_list_part['match_type']) != '') { $high_val = strtolower($message_highlight_list_part['value']); $match_type = strtoupper($message_highlight_list_part['match_type']); if($match_type == 'TO_CC') { @@ -192,12 +192,13 @@ case('TO'): case('CC'): case('FROM'): - foreach ($msg[$match_type] as $address) { + $aAddresses = parseAddress($msg[$match_type]); + foreach ($aAddresses as $address) { $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']; + $hlt_color = '#' . $message_highlight_list_part['color']; break 4; } } @@ -205,7 +206,7 @@ default: $headertest = strtolower(decodeHeader($msg[$match_type], true, false)); if (strstr('^^' . $headertest, $high_val)) { - $hlt_color = $message_highlight_list_part['color']; + $hlt_color = '#' . $message_highlight_list_part['color']; break 3; } break; diff -ur nasmail-1.6.1.orig/src/options_highlight.php nasmail-1.6.1/src/options_highlight.php --- nasmail-1.6.1.orig/src/options_highlight.php 2007-11-06 08:35:15.000000000 +0200 +++ nasmail-1.6.1/src/options_highlight.php 2009-08-04 09:13:02.000000000 +0300 @@ -58,6 +58,8 @@ $message_highlight_list = array(); } +displayPageHeader($color, ''); + if (isset($theid) && ($action == 'delete') || ($action == 'up') || ($action == 'down')) { @@ -91,8 +93,6 @@ setPref($data_dir, $username, 'hililist', serialize($message_highlight_list)); - nsm_http_redirect('options_highlight.php'); - exit; } else if ($action == 'save') { if ($color_type == 1) $newcolor = $newcolor_choose; @@ -104,19 +104,24 @@ $newcolor = str_replace('\'', '', $newcolor); $value = str_replace(',', ' ', $value); - if(isset($theid)) { - $message_highlight_list[$theid] = - array( 'name' => $identname, 'color' => $newcolor, - 'value' => $value, 'match_type' => $match_type ); - } else { - $message_highlight_list[] = - array( 'name' => $identname, 'color' => $newcolor, - 'value' => $value, 'match_type' => $match_type ); - } + if (! preg_match('/^[0-9a-f]{6}$|^[0-9a-f]{3}$/i',$newcolor)) { + echo '
'; + error_box(_("Invalid HTML color code"),$color); + echo '
'; + } else { + if(isset($theid)) { + $message_highlight_list[$theid] = + array( 'name' => $identname, 'color' => $newcolor, + 'value' => $value, 'match_type' => $match_type ); + } else { + $message_highlight_list[] = + array( 'name' => $identname, 'color' => $newcolor, + 'value' => $value, 'match_type' => $match_type ); + } - setPref($data_dir, $username, 'hililist', serialize($message_highlight_list)); + setPref($data_dir, $username, 'hililist', serialize($message_highlight_list)); + } } -displayPageHeader($color, ''); $title = _("Options") . ' - ' . _("Message Highlighting"); echo nsm_page_title($title);