diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2007-03-01 20:40:00 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2007-03-01 20:40:00 +0000 |
| commit | ae1617c3ff0ebca9310455fd2c54736f62df9fbf (patch) | |
| tree | 8c179b1c3699e16848882ad839dad6681aa0453a /roundcubemail/program/steps/mail | |
| parent | 8781d05424a0ebd32845edf17769c2cc69e9bb1d (diff) | |
Solved wrong caching of message preview (#1484153, #1484236)
git-svn-id: https://svn.roundcube.net/trunk@500 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail')
| -rw-r--r-- | roundcubemail/program/steps/mail/show.inc | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/roundcubemail/program/steps/mail/show.inc b/roundcubemail/program/steps/mail/show.inc index 841a41b36..19e6e56a9 100644 --- a/roundcubemail/program/steps/mail/show.inc +++ b/roundcubemail/program/steps/mail/show.inc @@ -23,21 +23,14 @@ require_once('Mail/mimeDecode.php'); $PRINT_MODE = $_action=='print' ? TRUE : FALSE; -// allow caching, unless remote images are present -if ((bool)get_input_value('_safe', RCUBE_INPUT_GET)) - send_nocacheing_headers(); -else - send_future_expire_header(); - // similar code as in program/steps/mail/get.inc if ($_GET['_uid']) { $MESSAGE = array('UID' => get_input_value('_uid', RCUBE_INPUT_GET)); $MESSAGE['headers'] = $IMAP->get_headers($MESSAGE['UID']); - $MESSAGE['structure'] = $IMAP->get_structure($MESSAGE['UID']); // go back to list if message not found (wrong UID) - if (!$MESSAGE['headers'] || !$MESSAGE['structure']) + if (!$MESSAGE['headers']) { show_message('messageopenerror', 'error'); if ($_action=='preview' && template_exists('messagepreview')) @@ -49,9 +42,19 @@ if ($_GET['_uid']) } } + // calculate Etag for this request + $etag = md5($MESSAGE['UID'].$IMAP->get_mailbox_name().session_id().($PRINT_MODE?1:0)); + + // allow caching, unless remote images are present + if ((bool)get_input_value('_safe', RCUBE_INPUT_GET)) + send_nocacheing_headers(); + else + send_modified_header($_SESSION['login_time'], $etag); + + $MESSAGE['subject'] = $IMAP->decode_header($MESSAGE['headers']->subject); - if ($MESSAGE['structure']) + if ($MESSAGE['structure'] = $IMAP->get_structure($MESSAGE['UID'])) list($MESSAGE['parts'], $MESSAGE['attachments']) = rcmail_parse_message( $MESSAGE['structure'], array('safe' => (bool)$_GET['_safe'], |
