summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-08-15 15:32:02 +0200
committerAleksander Machniak <alec@alec.pl>2012-08-15 15:33:46 +0200
commitde9497cea760849a05f52848b9a670a7006b97d6 (patch)
treebc9fc6066b2c45b24c7ca9c82939ac39868c9a0b /program
parent14c4677eede6263f26b8830917ec6e74409b80c4 (diff)
Fix line separator in exported messages (#1488603)
Diffstat (limited to 'program')
-rw-r--r--program/include/rcube_imap.php7
-rw-r--r--program/include/rcube_imap_generic.php4
-rw-r--r--program/include/rcube_storage.php5
-rw-r--r--program/steps/mail/viewsource.inc2
4 files changed, 12 insertions, 6 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index 6b8cc2971..bc1585e13 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -2128,14 +2128,17 @@ class rcube_imap extends rcube_storage
/**
* Sends the whole message source to stdout
+ *
+ * @param int $uid Message UID
+ * @param bool $formatted Enables line-ending formatting
*/
- public function print_raw_body($uid)
+ public function print_raw_body($uid, $formatted = true)
{
if (!$this->check_connection()) {
return;
}
- $this->conn->handlePartBody($this->folder, $uid, true, NULL, NULL, true);
+ $this->conn->handlePartBody($this->folder, $uid, true, null, null, true, null, $formatted);
}
diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php
index 8b75e3849..f70b91b04 100644
--- a/program/include/rcube_imap_generic.php
+++ b/program/include/rcube_imap_generic.php
@@ -2455,7 +2455,7 @@ class rcube_imap_generic
return $this->handlePartBody($mailbox, $id, $is_uid, $part);
}
- function handlePartBody($mailbox, $id, $is_uid=false, $part='', $encoding=NULL, $print=NULL, $file=NULL)
+ function handlePartBody($mailbox, $id, $is_uid=false, $part='', $encoding=NULL, $print=NULL, $file=NULL, $formatted=true)
{
if (!$this->select($mailbox)) {
return false;
@@ -2572,7 +2572,7 @@ class rcube_imap_generic
continue;
$line = convert_uudecode($line);
// default
- } else {
+ } else if ($formatted) {
$line = rtrim($line, "\t\r\n\0\x0B") . "\n";
}
diff --git a/program/include/rcube_storage.php b/program/include/rcube_storage.php
index 8123e9cee..8daedf133 100644
--- a/program/include/rcube_storage.php
+++ b/program/include/rcube_storage.php
@@ -505,8 +505,11 @@ abstract class rcube_storage
/**
* Sends the whole message source to stdout
+ *
+ * @param int $uid Message UID
+ * @param bool $formatted Enables line-ending formatting
*/
- abstract function print_raw_body($uid);
+ abstract function print_raw_body($uid, $formatted = true);
/**
diff --git a/program/steps/mail/viewsource.inc b/program/steps/mail/viewsource.inc
index f38ca76eb..536c6b3da 100644
--- a/program/steps/mail/viewsource.inc
+++ b/program/steps/mail/viewsource.inc
@@ -47,7 +47,7 @@ if ($uid = get_input_value('_uid', RCUBE_INPUT_GET))
header("Content-Disposition: attachment; filename=\"$filename\"");
}
- $RCMAIL->storage->print_raw_body($uid);
+ $RCMAIL->storage->print_raw_body($uid, empty($_GET['_save']));
}
else
{