summaryrefslogtreecommitdiff
path: root/plugins/zipdownload/zipdownload.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/zipdownload/zipdownload.php')
-rw-r--r--plugins/zipdownload/zipdownload.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/plugins/zipdownload/zipdownload.php b/plugins/zipdownload/zipdownload.php
index 96c76eec9..59431267d 100644
--- a/plugins/zipdownload/zipdownload.php
+++ b/plugins/zipdownload/zipdownload.php
@@ -30,9 +30,9 @@ class zipdownload extends rcube_plugin
}
$rcmail = rcmail::get_instance();
- $this->charset = $rcmail->config->get('zipdownload_charset', RCUBE_CHARSET);
$this->load_config();
+ $this->charset = $rcmail->config->get('zipdownload_charset', RCUBE_CHARSET);
$this->add_texts('localization');
if ($rcmail->config->get('zipdownload_attachments', 1) > -1 && ($rcmail->action == 'show' || $rcmail->action == 'preview'))
@@ -108,7 +108,7 @@ class zipdownload extends rcube_plugin
foreach ($message->attachments as $part) {
$pid = $part->mime_id;
$part = $message->mime_parts[$pid];
- $disp_name = $this->_convert_filename($part->filename, $part->charset);
+ $disp_name = $this->_convert_filename($part->filename);
if ($part->body) {
$orig_message_raw = $part->body;
@@ -169,7 +169,7 @@ class zipdownload extends rcube_plugin
for ($i = 0; ($i * $imap->get_pagesize()) <= $count; $i++) {
$a_headers = $imap->list_messages($mbox_name, ($i + 1));
- foreach ($a_headers as $n => $header) {
+ foreach ($a_headers as $header) {
if (empty($header))
continue;
@@ -199,7 +199,7 @@ class zipdownload extends rcube_plugin
$zip = new ZipArchive();
$zip->open($tmpfname, ZIPARCHIVE::OVERWRITE);
- foreach ($uids as $key => $uid){
+ foreach ($uids as $uid){
$headers = $imap->get_message_headers($uid);
$subject = rcube_mime::decode_mime_string((string)$headers->subject);
$subject = $this->_convert_filename($subject);
@@ -211,7 +211,7 @@ class zipdownload extends rcube_plugin
$disp_name = "message_rfc822.eml";
$disp_name = $uid . "_" . $disp_name;
-
+
$tmpfn = tempnam($temp_dir, 'zipmessage');
$tmpfp = fopen($tmpfn, 'w');
$imap->get_raw_body($uid, $tmpfp);
@@ -263,10 +263,10 @@ class zipdownload extends rcube_plugin
/**
* Helper function to convert filenames to the configured charset
*/
- private function _convert_filename($str, $from = RCUBE_CHARSET)
+ private function _convert_filename($str)
{
- return strtr(rcube_charset::convert($str, $from, $this->charset), array(':'=>'', '/'=>'-'));
+ $str = rcube_charset::convert($str, RCUBE_CHARSET, $this->charset);
+
+ return strtr($str, array(':'=>'', '/'=>'-'));
}
}
-
-?> \ No newline at end of file