summaryrefslogtreecommitdiff
path: root/roundcubemail/program/steps/mail/func.inc
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-03-11 22:44:43 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-03-11 22:44:43 +0000
commitea2192a716fd087f969d01ba1a413756f41ce971 (patch)
treec4e3c2c0d6fec33b0ea654850b571a4a2913e003 /roundcubemail/program/steps/mail/func.inc
parent0916627239b62a93313be11c4355803038f9deec (diff)
Save draft information in one header; finally fixes #1486203
git-svn-id: https://svn.roundcube.net/trunk@3353 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail/func.inc')
-rw-r--r--roundcubemail/program/steps/mail/func.inc24
1 files changed, 24 insertions, 0 deletions
diff --git a/roundcubemail/program/steps/mail/func.inc b/roundcubemail/program/steps/mail/func.inc
index 101a978cd..3f2ac0289 100644
--- a/roundcubemail/program/steps/mail/func.inc
+++ b/roundcubemail/program/steps/mail/func.inc
@@ -1288,6 +1288,30 @@ function rcmail_wrap_quoted($text, $max = 76)
}
+function rcmail_draftinfo_encode($p)
+{
+ $parts = array();
+ foreach ($p as $key => $val)
+ $parts[] = $key . '=' . ($key == 'folder' ? base64_encode($val) : $val);
+
+ return join('; ', $parts);
+}
+
+
+function rcmail_draftinfo_decode($str)
+{
+ $info = array();
+ foreach (preg_split('/;\s+/', $str) as $part) {
+ list($key, $val) = explode('=', $part, 2);
+ if ($key == 'folder')
+ $val = base64_decode($val);
+ $info[$key] = $val;
+ }
+
+ return $info;
+}
+
+
function rcmail_message_part_controls()
{
global $MESSAGE;