From 68f76fddbebbe76d228f17f0cc6751b80758a861 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 30 Mar 2015 10:57:33 -0400
Subject: [PATCH] Fix handling of %-encoded entities in mailto: URLs (#1490346)

---
 CHANGELOG                      |    2 ++
 program/steps/mail/compose.inc |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 23e1fb9..c304280 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,8 @@
 CHANGELOG Roundcube Webmail
 ===========================
 
+- Fix handling of %-encoded entities in mailto: URLs (#1490346)
+
 RELEASE 1.1.1
 -------------
 - ACL: Allow other plugins to adjust the list of permissions and groups to edit
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 4c3ecfb..007efc5 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -448,6 +448,8 @@
 
         // #1486037: remove "mailto:" prefix
         $COMPOSE['param']['to'] = preg_replace('/^mailto:/i', '', $mailto[0]);
+        // #1490346: decode the recipient address
+        $COMPOSE['param']['to'] = urldecode($COMPOSE['param']['to']);
 
         // Supported case-insensitive tokens in mailto URL
         $url_tokens = array('to', 'cc', 'bcc', 'reply-to', 'in-reply-to', 'references', 'subject', 'body');

--
Gitblit v1.9.1