From 9297917ee127b69d3cd5947a3af0332679161b23 Mon Sep 17 00:00:00 2001 From: lkehresman Date: Mon, 31 Jul 2000 16:16:57 +0000 Subject: [PATCH] removed making search results highlighted -- messed up other parsing badly git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@661 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_messages.php | 5 ----- functions/mime.php | 1 - functions/strings.php | 2 ++ functions/url_parser.php | 16 ++++++++++++++++ src/read_body.php | 7 ++----- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/functions/imap_messages.php b/functions/imap_messages.php index fe7e7cbc..4aecad1b 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -45,7 +45,6 @@ } function sqimap_get_small_header ($imap_stream, $id, $sent) { - global $where, $what; fputs ($imap_stream, "a001 FETCH $id BODY.PEEK[HEADER.FIELDS (Date To From Cc Subject Message-Id X-Priority)]\r\n"); $read = sqimap_read_data ($imap_stream, "a001", true, $response, $message); @@ -78,10 +77,6 @@ } } - if ($where == "SUBJECT") { - $subject = eregi_replace($what, "\\0", $subject); - } - $header = new small_header; if ($sent == true) $header->from = $to; diff --git a/functions/mime.php b/functions/mime.php index 2e559fbb..e864b7b7 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -454,7 +454,6 @@ $body .= ""; $num = 0; - /** make this recurisve at some point **/ $body .= formatAttachments ($message, $ent_num, $message->header->mailbox, $id); $body .= ""; } diff --git a/functions/strings.php b/functions/strings.php index 7906d138..c3f2e4c0 100644 --- a/functions/strings.php +++ b/functions/strings.php @@ -114,6 +114,8 @@ } function translateText($body, $wrap_at, $charset) { + global $where, $what; // from searching + if (!isset($url_parser_php)) { include "../functions/url_parser.php"; } diff --git a/functions/url_parser.php b/functions/url_parser.php index cc0accca..64e308a5 100644 --- a/functions/url_parser.php +++ b/functions/url_parser.php @@ -11,6 +11,22 @@ } function parseEmail ($body) { + global $color; + /* + This is here in case we ever decide to use highlighting of searched + text. this does it for email addresses + + if ($what && ($where == "BODY" || $where == "TEXT")) { + eregi ("([a-z]|[0-9]|_|\.|-)+\@([a-z]|[0-9]|_|-)+(\.([a-z]|[0-9]|_|-)+)*", $body, $regs); + $oldaddr = $regs[0]; + if ($oldaddr) { + $newaddr = eregi_replace ($what, "$what", $oldaddr); + $body = str_replace ($oldaddr, "$newaddr", $body); + } + } else { + $body = eregi_replace ("([a-z]|[0-9]|_|\.|-)+\@([a-z]|[0-9]|_|-)+(\.([a-z]|[0-9]|_|-)+)*", "\\0", $body); + } + */ $body = eregi_replace ("([a-z]|[0-9]|_|\.|-)+\@([a-z]|[0-9]|_|-)+(\.([a-z]|[0-9]|_|-)+)*", "\\0", $body); return $body; } diff --git a/src/read_body.php b/src/read_body.php index dc3c308a..bd9fa35a 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -317,13 +317,10 @@ echo "\n"; echo " \n"; -- 2.25.1
\n"; - $body = formatBody($imapConnection, $message, $color, $wrap_at); echo "
"; + + $body = formatBody($imapConnection, $message, $color, $wrap_at); - $whatnew = str_replace(" ", " ", $what); - if ($where == "BODY" || $where == "TEXT") { - $body = eregi_replace($whatnew, "\\0", $body); - } echo "$body"; echo "