From ea2192a716fd087f969d01ba1a413756f41ce971 Mon Sep 17 00:00:00 2001 From: thomasb Date: Thu, 11 Mar 2010 22:44:43 +0000 Subject: Save draft information in one header; finally fixes #1486203 git-svn-id: https://svn.roundcube.net/trunk@3353 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/program/steps/mail/func.inc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'roundcubemail/program/steps/mail/func.inc') 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; -- cgit v1.2.3