Fix filenames charset handling (#1488946)

pull/15/head
Aleksander Machniak 12 years ago
parent a7e8ebc509
commit dafb50aa49

@ -30,9 +30,9 @@ class zipdownload extends rcube_plugin
} }
$rcmail = rcmail::get_instance(); $rcmail = rcmail::get_instance();
$this->charset = $rcmail->config->get('zipdownload_charset', RCUBE_CHARSET);
$this->load_config(); $this->load_config();
$this->charset = $rcmail->config->get('zipdownload_charset', RCUBE_CHARSET);
$this->add_texts('localization'); $this->add_texts('localization');
if ($rcmail->config->get('zipdownload_attachments', 1) > -1 && ($rcmail->action == 'show' || $rcmail->action == 'preview')) if ($rcmail->config->get('zipdownload_attachments', 1) > -1 && ($rcmail->action == 'show' || $rcmail->action == 'preview'))
@ -265,8 +265,8 @@ class zipdownload extends rcube_plugin
*/ */
private function _convert_filename($str, $from = RCUBE_CHARSET) private function _convert_filename($str, $from = RCUBE_CHARSET)
{ {
return strtr(rcube_charset::convert($str, $from, $this->charset), array(':'=>'', '/'=>'-')); $str = rcube_charset::convert($str, $from == '' ? RCUBE_CHARSET : $from, $this->charset);
return strtr($str, array(':'=>'', '/'=>'-'));
} }
} }
?>
Loading…
Cancel
Save