Mercurial > hg > rc2
comparison program/steps/mail/headers.inc @ 0:4681f974d28b
vanilla 1.3.3 distro, I hope
author | Charlie Root |
---|---|
date | Thu, 04 Jan 2018 15:52:31 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4681f974d28b |
---|---|
1 <?php | |
2 | |
3 /** | |
4 +-----------------------------------------------------------------------+ | |
5 | program/steps/mail/headers.inc | | |
6 | | | |
7 | This file is part of the Roundcube Webmail client | | |
8 | Copyright (C) 2005-2016, The Roundcube Dev Team | | |
9 | | | |
10 | Licensed under the GNU General Public License version 3 or | | |
11 | any later version with exceptions for skins & plugins. | | |
12 | See the README file for a full license statement. | | |
13 | | | |
14 | PURPOSE: | | |
15 | Fetch message headers in raw format for display | | |
16 | | | |
17 +-----------------------------------------------------------------------+ | |
18 | Author: Aleksander Machniak <alec@alec.pl> | | |
19 +-----------------------------------------------------------------------+ | |
20 */ | |
21 | |
22 if ($uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_POST)) { | |
23 if ($pos = strpos($uid, '.')) { | |
24 $message = new rcube_message($uid); | |
25 $source = $message->get_part_body(substr($uid, $pos + 1)); | |
26 $source = substr($source, 0, strpos($source, "\r\n\r\n")); | |
27 } | |
28 else { | |
29 $source = $RCMAIL->storage->get_raw_headers($uid); | |
30 } | |
31 | |
32 if ($source !== false) { | |
33 $source = trim(rcube_charset::clean($source)); | |
34 $source = htmlspecialchars($source); | |
35 $source = preg_replace( | |
36 array( | |
37 '/\n[\t\s]+/', | |
38 '/^([a-z0-9_:-]+)/im', | |
39 '/\r?\n/' | |
40 ), | |
41 array( | |
42 "\n ", | |
43 '<font class="bold">\1</font>', | |
44 '<br />' | |
45 ), $source); | |
46 | |
47 $OUTPUT->command('set_headers', $source); | |
48 } | |
49 else { | |
50 $RCMAIL->output->show_message('messageopenerror', 'error'); | |
51 } | |
52 | |
53 $OUTPUT->send(); | |
54 } | |
55 | |
56 exit; |