X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fview_header.php;h=19198b1bc22d8337ffb5f89a456cc695e9b23342;hb=8d8da447778a43b78bc95f9601b385416ad84477;hp=4f2da59faca842b9360178a31caf99e19285885c;hpb=8650e9e14aaea9a02c0967991b638ab1adfae9fd;p=squirrelmail.git diff --git a/src/view_header.php b/src/view_header.php index 4f2da59f..19198b1b 100644 --- a/src/view_header.php +++ b/src/view_header.php @@ -3,15 +3,19 @@ /** * view_header.php * - * Copyright (c) 1999-2003 The SquirrelMail Project Team + * Copyright (c) 1999-2004 The SquirrelMail Project Team * Licensed under the GNU GPL. For full terms see the file COPYING. * * This is the code to view the message header. * - * $Id$ + * @version $Id$ + * @package squirrelmail */ -/* Path for SquirrelMail required files. */ +/** + * Path for SquirrelMail required files. + * @ignore + */ define('SM_PATH','../'); /* SquirrelMail required files. */ @@ -22,39 +26,37 @@ require_once(SM_PATH . 'functions/html.php'); require_once(SM_PATH . 'functions/url_parser.php'); function parse_viewheader($imapConnection,$id, $passed_ent_id) { - global $uid_support; - $header_full = array(); - if (!$passed_ent_id) { - $read=sqimap_run_command ($imapConnection, "FETCH $id BODY[HEADER]", - true, $a, $b, $uid_support); - } else { - $query = "FETCH $id BODY[".$passed_ent_id.'.HEADER]'; - $read=sqimap_run_command ($imapConnection, $query, - true, $a, $b, $uid_support); - } + if (!$passed_ent_id) { + $read=sqimap_run_command ($imapConnection, "FETCH $id BODY[HEADER]", + true, $a, $b, TRUE); + } else { + $query = "FETCH $id BODY[".$passed_ent_id.'.HEADER]'; + $read=sqimap_run_command ($imapConnection, $query, + true, $a, $b, TRUE); + } $cnum = 0; for ($i=1; $i < count($read); $i++) { $line = htmlspecialchars($read[$i]); - switch (true) { - case (eregi("^>", $line)): - $second[$i] = $line; - $first[$i] = ' '; - $cnum++; - break; - case (eregi("^[ |\t]", $line)): - $second[$i] = $line; - $first[$i] = ''; - break; - case (eregi("^([^:]+):(.+)", $line, $regs)): - $first[$i] = $regs[1] . ':'; - $second[$i] = $regs[2]; - $cnum++; - break; - default: - $second[$i] = trim($line); - $first[$i] = ''; - break; + switch (true) { + case (eregi("^>", $line)): + $second[$i] = $line; + $first[$i] = ' '; + $cnum++; + break; + case (eregi("^[ |\t]", $line)): + $second[$i] = $line; + $first[$i] = ''; + break; + case (eregi("^([^:]+):(.+)", $line, $regs)): + $first[$i] = $regs[1] . ':'; + $second[$i] = $regs[2]; + $cnum++; + break; + default: + $second[$i] = trim($line); + $first[$i] = ''; + break; } } for ($i=0; $i < count($second); $i = $j) { @@ -65,9 +67,11 @@ function parse_viewheader($imapConnection,$id, $passed_ent_id) { $s .= '    ' . nl2br($second[$j]); $j++; } - if(strtolower($f) != 'message-id:') { - parseEmail($s); - } + $lowf=strtolower($f); + /* do not mark these headers as emailaddresses */ + if($lowf != 'message-id:' && $lowf != 'in-reply-to:' && $lowf != 'references:') { + parseEmail($s); + } if ($f) { $header_output[] = array($f,$s); } @@ -82,24 +86,25 @@ function view_header($header, $mailbox, $color) { displayPageHeader($color, $mailbox); - echo '
' . - '' . "\n" . - "
". - _("Viewing Full Header") . ' - '. + echo '
' . + '' . "\n" . + '
'. + _("Viewing Full Header") . ' - '. '' ._("View message") . "
\n"; echo_template_var($header, - array( - "\n".'
', - '', - '', - '', - '
'."\n" - ) ); + array( + '\n".'
', + '', + '', + '', + '
'."\n" + ) + ); echo ''; } @@ -125,4 +130,4 @@ $mbx_response = sqimap_mailbox_select($imapConnection, $mailbox, false, false, t $header = parse_viewheader($imapConnection,$passed_id, $passed_ent_id); view_header($header, $mailbox, $color); -?> +?> \ No newline at end of file