Quote dynamic regex contents to be safe. Thanks to Daniel Hahler.
[squirrelmail.git] / src / image.php
1 <?php
2
3 /**
4 * image.php
5 *
6 * This file shows an attached image
7 *
8 * @copyright 1999-2009 The SquirrelMail Project Team
9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
10 * @version $Id$
11 * @package squirrelmail
12 */
13
14 /** This is the image page */
15 define('PAGE_NAME', 'image');
16
17 /**
18 * Include the SquirrelMail initialization file.
19 */
20 require('../include/init.php');
21
22 displayPageHeader($color);
23
24 /* globals */
25 sqgetGlobalVar('passed_id', $passed_id, SQ_GET, NULL, SQ_TYPE_BIGINT);
26 sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
27 sqgetGlobalVar('ent_id', $ent_id, SQ_GET);
28 sqgetGlobalVar('QUERY_STRING', $QUERY_STRING, SQ_SERVER);
29 /* end globals */
30
31 echo '<br />' .
32 '<table width="100%" border="0" cellspacing="0" cellpadding="2" align="center">' .
33 "\n" .
34 '<tr><td bgcolor="' . $color[0] . '">' .
35 '<div style="text-align: center;"><b>' .
36 _("Viewing an image attachment") . " - ";
37
38 $msg_url = 'read_body.php?' . $QUERY_STRING;
39 $msg_url = set_url_var($msg_url, 'ent_id', 0);
40 echo '<a href="'.$msg_url.'">'. _("View message") . '</a>';
41
42
43 $DownloadLink = '../src/download.php?passed_id=' . $passed_id .
44 '&amp;mailbox=' . urlencode($mailbox) .
45 '&amp;ent_id=' . urlencode($ent_id) . '&amp;absolute_dl=true';
46
47 ?>
48 </b></div></td></tr>
49 <tr><td align="center">
50 <a href="<?php echo $DownloadLink; ?>"><?php echo _("Download this as a file"); ?></a>
51 <br />&nbsp;</td></tr></table>
52
53 <table border="0" cellspacing="0" cellpadding="2" align="center">
54 <tr><td bgcolor="<?php echo $color[4]; ?>">
55 <img src="<?php echo $DownloadLink; ?>" />
56
57 </td></tr></table>
58 <?php
59 $oTemplate->display('footer.tpl');