summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-01-17 13:36:51 +0000
committeralecpl <alec@alec.pl>2011-01-17 13:36:51 +0000
commit824144214f82b4f00a82ac688a9adea7386c1bd0 (patch)
tree238722f20d8c38a41c3c98458746ddec4b782beb /program
parenta76cbddfc92adbf4e8cb18dda5f668ec4de8a114 (diff)
- Workaround for setting charset in case of malformed bodystructure response (#1487700)
Diffstat (limited to 'program')
-rw-r--r--program/include/rcube_imap.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index efbd95f84..fa7998338 100644
--- a/program/include/rcube_imap.php
+++ b/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]);