You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

headers.inc 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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, The Roundcube Dev Team |
  8. | |
  9. | Licensed under the GNU General Public License version 3 or |
  10. | any later version with exceptions for skins & plugins. |
  11. | See the README file for a full license statement. |
  12. | |
  13. | PURPOSE: |
  14. | Fetch message headers in raw format for display |
  15. | |
  16. +-----------------------------------------------------------------------+
  17. | Author: Aleksander Machniak <alec@alec.pl> |
  18. +-----------------------------------------------------------------------+
  19. */
  20. if ($uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_POST)) {
  21. $source = $RCMAIL->storage->get_raw_headers($uid);
  22. if ($source !== false) {
  23. $source = trim(rcube_charset::clean($source));
  24. $source = htmlspecialchars($source);
  25. $source = preg_replace(
  26. array(
  27. '/\n[\t\s]+/',
  28. '/^([a-z0-9_:-]+)/im',
  29. '/\r?\n/'
  30. ),
  31. array(
  32. "\n&nbsp;&nbsp;&nbsp;&nbsp;",
  33. '<font class="bold">\1</font>',
  34. '<br />'
  35. ), $source);
  36. $OUTPUT->command('set_headers', $source);
  37. }
  38. else {
  39. $RCMAIL->output->show_message('messageopenerror', 'error');
  40. }
  41. $OUTPUT->send();
  42. }
  43. exit;