Aleksander Machniak
2013-12-31 f5d2eef55c89b7f1a5549704705c25fd7f0c0185
program/steps/mail/viewsource.inc
@@ -5,7 +5,7 @@
 | program/steps/mail/viewsource.inc                                     |
 |                                                                       |
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2009, The Roundcube Dev Team                       |
 | Copyright (C) 2005-2013, The Roundcube Dev Team                       |
 |                                                                       |
 | Licensed under the GNU General Public License version 3 or            |
 | any later version with exceptions for skins & plugins.                |
@@ -22,10 +22,10 @@
ob_end_clean();
// similar code as in program/steps/mail/get.inc
if ($uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_GET))
{
if ($uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_GET)) {
  $headers = $RCMAIL->storage->get_message_headers($uid);
  $charset = $headers->charset ? $headers->charset : $CONFIG['default_charset'];
    $charset = $headers->charset ? $headers->charset : $RCMAIL->config->get('default_charset');
  header("Content-Type: text/plain; charset={$charset}");
  if (!empty($_GET['_save'])) {
@@ -46,15 +46,15 @@
  $RCMAIL->storage->print_raw_body($uid, empty($_GET['_save']));
}
else
{
else {
  rcube::raise_error(array(
      'code' => 500,
      'type' => 'php',
      'file' => __FILE__, 'line' => __LINE__,
      'message' => 'Message UID '.$uid.' not found'),
            'file'    => __FILE__,
            'line'    => __LINE__,
            'message' => "Message UID $uid not found"
        ),
    true, true);
}
exit;