vcard_attachments: Fix bug where national characters in vCard would be broken on import/display

pull/5241/head
Aleksander Machniak 9 years ago
parent ce3105c58f
commit 414ae36baa

@ -65,7 +65,7 @@ class vcard_attachments extends rcube_plugin
$attach_script = false; $attach_script = false;
foreach ($this->vcard_parts as $part) { foreach ($this->vcard_parts as $part) {
$vcards = rcube_vcard::import($this->message->get_part_body($part, true)); $vcards = rcube_vcard::import($this->message->get_part_content($part, null, true));
// successfully parsed vcards? // successfully parsed vcards?
if (empty($vcards)) { if (empty($vcards)) {
@ -93,7 +93,7 @@ class vcard_attachments extends rcube_plugin
'title' => $this->gettext('addvcardmsg'), 'title' => $this->gettext('addvcardmsg'),
), ),
html::span(null, rcube::Q($display))) html::span(null, rcube::Q($display)))
); );
} }
$attach_script = true; $attach_script = true;
@ -119,12 +119,11 @@ class vcard_attachments extends rcube_plugin
$mime_id = rcube_utils::get_input_value('_part', rcube_utils::INPUT_POST); $mime_id = rcube_utils::get_input_value('_part', rcube_utils::INPUT_POST);
$rcmail = rcmail::get_instance(); $rcmail = rcmail::get_instance();
$storage = $rcmail->get_storage(); $message = new rcube_message($uid, $mbox);
$storage->set_folder($mbox);
if ($uid && $mime_id) { if ($uid && $mime_id) {
list($mime_id, $index) = explode(':', $mime_id); list($mime_id, $index) = explode(':', $mime_id);
$part = $storage->get_message_part($uid, $mime_id, null, null, null, true); $part = $message->get_part_content($mime_id, null, true);
} }
$error_msg = $this->gettext('vcardsavefailed'); $error_msg = $this->gettext('vcardsavefailed');

Loading…
Cancel
Save