From 8297ea1dcfbad6390cdaac6c941b72be59abf300 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Fri, 28 Aug 2015 03:02:39 -0400
Subject: [PATCH] Fix handling of plus character in mailto: links (#1490510)

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

diff --git a/CHANGELOG b/CHANGELOG
index 67fb2b0..677884b 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -44,6 +44,7 @@
 - Fix "washing" of style elements wrapped into many lines
 - Fix so input field (e.g. search box) does not loose focus on list load (#1490455)
 - Fix so css of one html part does not apply to other text parts on message display (#1490505)
+- Fix handling of plus character in mailto: links (#1490510)
 
 RELEASE 1.1.2
 -------------
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 2e1c240..402b32c 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -317,7 +317,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']);
+        // #1490510: use raw encoding for correct "+" character handling as specified in RFC6068
+        $COMPOSE['param']['to'] = rawurldecode($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