diff options
author | alecpl <alec@alec.pl> | 2010-06-08 12:46:05 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2010-06-08 12:46:05 +0000 |
commit | 64e3e80743415e5fb121eb5c66416593c38ef288 (patch) | |
tree | fdf160e8eb9580deab6c4fc2cbdb3ceb63d3c76f /program/steps/mail/headers.inc | |
parent | b93d00026aefbdccfabd6253f9cb184956617084 (diff) |
- Fix some IMAP errors handling when opening the message (#1485443)
Diffstat (limited to 'program/steps/mail/headers.inc')
-rw-r--r-- | program/steps/mail/headers.inc | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/program/steps/mail/headers.inc b/program/steps/mail/headers.inc index 946a688e9..aa1065531 100644 --- a/program/steps/mail/headers.inc +++ b/program/steps/mail/headers.inc @@ -20,28 +20,31 @@ if ($uid = get_input_value('_uid', RCUBE_INPUT_POST)) { - $source = $IMAP->get_raw_headers($uid); - - if ($source) - { - $source = htmlspecialchars(trim($source)); - $source = preg_replace( - array( - '/\n[\t\s]+/', - '/^([a-z0-9_:-]+)/im', - '/\r?\n/' - ), - array( - "\n ", - '<font class="bold">\1</font>', - '<br />' - ), $source); - - $OUTPUT->command('set_headers', $source); - $OUTPUT->send(); + $source = $IMAP->get_raw_headers($uid); + + if ($source !== false) { + $source = htmlspecialchars(trim($source)); + $source = preg_replace( + array( + '/\n[\t\s]+/', + '/^([a-z0-9_:-]+)/im', + '/\r?\n/' + ), + array( + "\n ", + '<font class="bold">\1</font>', + '<br />' + ), $source); + + $OUTPUT->command('set_headers', $source); + } + else { + $RCMAIL->output->show_message('messageopenerror', 'error'); } + + $OUTPUT->send(); } - + exit; ?> |