]> git.donarmstrong.com Git - roundcube.git/blob - program/steps/mail/headers.inc
Imported Upstream version 0.5
[roundcube.git] / program / steps / mail / headers.inc
1 <?php
2 /*
3  +-----------------------------------------------------------------------+
4  | program/steps/mail/headers.inc                                        |
5  |                                                                       |
6  | This file is part of the Roundcube Webmail client                     |
7  | Copyright (C) 2005-2007, Roundcube Dev. - Switzerland                 |
8  | Licensed under the GNU GPL                                            |
9  |                                                                       |
10  | PURPOSE:                                                              |
11  |   Fetch message headers in raw format for display                     |
12  |                                                                       |
13  +-----------------------------------------------------------------------+
14  | Author: Aleksander Machniak <alec@alec.pl>                            |
15  +-----------------------------------------------------------------------+
16
17  $Id: headers.inc 3989 2010-09-25 13:03:53Z alec $
18
19 */
20
21 if ($uid = get_input_value('_uid', RCUBE_INPUT_POST))
22 {
23     $source = $IMAP->get_raw_headers($uid);
24
25     if ($source !== false) {
26         $source = htmlspecialchars(trim($source));
27         $source = preg_replace(
28             array(
29                 '/\n[\t\s]+/',
30                 '/^([a-z0-9_:-]+)/im',
31                 '/\r?\n/'
32             ),
33             array(
34                 "\n&nbsp;&nbsp;&nbsp;&nbsp;",
35                 '<font class="bold">\1</font>',
36                 '<br />'
37             ), $source);
38
39         $OUTPUT->command('set_headers', $source);
40     }
41     else {
42         $RCMAIL->output->show_message('messageopenerror', 'error');
43     }
44
45     $OUTPUT->send();
46 }
47
48 exit;
49
50