From 9b06107f55a726f152dd093996b34f926eab123b Mon Sep 17 00:00:00 2001 From: alec Date: Mon, 17 Jan 2011 13:36:51 +0000 Subject: - Workaround for setting charset in case of malformed bodystructure response (#1487700) git-svn-id: https://svn.roundcube.net/trunk@4421 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/program/include/rcube_imap.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'roundcubemail/program/include') diff --git a/roundcubemail/program/include/rcube_imap.php b/roundcubemail/program/include/rcube_imap.php index efbd95f84..fa7998338 100644 --- a/roundcubemail/program/include/rcube_imap.php +++ b/roundcubemail/program/include/rcube_imap.php @@ -2053,7 +2053,7 @@ class rcube_imap return false; } - $struct = &$this->_structure_part($structure); + $struct = &$this->_structure_part($structure, 0, '', $headers); $struct->headers = get_object_vars($headers); // don't trust given content-type @@ -2185,6 +2185,11 @@ class rcube_imap $struct->charset = $struct->ctype_parameters['charset']; } + // #1487700: workaround for lack of charset in malformed structure + if (empty($struct->charset) && !empty($mime_headers) && $mime_headers->charset) { + $struct->charset = $mime_headers->charset; + } + // read content encoding if (!empty($part[5]) && $part[5]!='NIL') { $struct->encoding = strtolower($part[5]); -- cgit v1.2.3