| | |
| | | * an object structure similar to the one generated by PEAR::Mail_mimeDecode |
| | | * |
| | | * @param int Message UID to fetch |
| | | * @return object stdClass Message part tree or False on failure |
| | | * @return object rcube_message_part Message part tree or False on failure |
| | | */ |
| | | function &get_structure($uid) |
| | | { |
| | |
| | | if ($this->caching_enabled) |
| | | $this->add_message_cache($cache_key, $msg_id, $headers, $struct); |
| | | } |
| | | |
| | | |
| | | return $struct; |
| | | } |
| | | |
| | |
| | | } |
| | | else if (!empty($filename_encoded)) { |
| | | // decode filename according to RFC 2231, Section 4 |
| | | list($filename_charset,, $filename_urlencoded) = split('\'', $filename_encoded); |
| | | $part->filename = rcube_charset_convert(urldecode($filename_urlencoded), $filename_charset); |
| | | if (preg_match("/^([^']*)'[^']*'(.*)$/", $filename_encoded, $fmatches)) { |
| | | $filename_charset = $fmatches[1]; |
| | | $filename_encoded = $fmatches[2]; |
| | | } |
| | | $part->filename = rcube_charset_convert(urldecode($filename_encoded), $filename_charset); |
| | | } |
| | | } |
| | | |