From aa2486beb3a5dec4315f2a9cf29358c523030e78 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Fri, 25 Mar 2016 06:41:08 -0400
Subject: [PATCH] vcard_attachments: Fix bug where national characters in vCard would be broken on import/display

---
 plugins/vcard_attachments/vcard_attachments.php |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/plugins/vcard_attachments/vcard_attachments.php b/plugins/vcard_attachments/vcard_attachments.php
index 74718be..622f890 100644
--- a/plugins/vcard_attachments/vcard_attachments.php
+++ b/plugins/vcard_attachments/vcard_attachments.php
@@ -65,7 +65,7 @@
         $attach_script = false;
 
         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?
             if (empty($vcards)) {
@@ -93,7 +93,7 @@
                         'title' => $this->gettext('addvcardmsg'),
                         ),
                         html::span(null, rcube::Q($display)))
-                    );
+                );
             }
 
             $attach_script = true;
@@ -119,12 +119,11 @@
         $mime_id = rcube_utils::get_input_value('_part', rcube_utils::INPUT_POST);
 
         $rcmail  = rcmail::get_instance();
-        $storage = $rcmail->get_storage();
-        $storage->set_folder($mbox);
+        $message = new rcube_message($uid, $mbox);
 
         if ($uid && $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');

--
Gitblit v1.9.1