From 2fcdcb5afe8ec767ec2a69f7441f85641d1dd426 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 13 Nov 2019 16:12:32 +0100 Subject: [PATCH] * CalDAV/Calendar: iOS also no longer allowed to accept/reject invitations now we skip encoding href attributes with mailto: urls independent of user-agent --- api/src/WebDAV/Server.php | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/api/src/WebDAV/Server.php b/api/src/WebDAV/Server.php index 290193b990..2a80bbeae8 100644 --- a/api/src/WebDAV/Server.php +++ b/api/src/WebDAV/Server.php @@ -1058,7 +1058,11 @@ class HTTP_WebDAV_Server if (isset($subprop['raw'])) { $vals .= ''; } else { - if($subprop['name'] == 'href') $subprop['val'] = $this->_urlencode($subprop['val']); + // do NOT urlencode mailto href, as no clients understands them + if ($subprop['name'] == 'href' && strpos($subprop['val'], 'mailto:') !== 0) + { + $subprop['val'] = $this->_urlencode($subprop['val']); + } $vals .= htmlspecialchars($subprop['val'], ENT_NOQUOTES|ENT_XML1|ENT_DISALLOWED, 'utf-8'); } $vals .= ""; @@ -2706,19 +2710,6 @@ class HTTP_WebDAV_Server */ public static function _urlencode($url) { - // Thunderbird Lightning 68+ does not recognice participants, - // if EMail in principal (calendar-user-address-set) is encoded - if (strpos($_SERVER['HTTP_USER_AGENT'], 'Lightning') !== false) - { - return strtr($url, array( - ' ' => '%20', - '%' => '%25', - '&' => '%26', - '<' => '%3C', - '>' => '%3E', - '+' => '%2B', - )); - } return strtr(rawurlencode($url),array( '%2F' => '/', '%3A' => ':', @@ -2811,8 +2802,8 @@ class HTTP_WebDAV_Server $val = $this->_prop_encode(''); } else { $val = $this->_prop_encode(htmlspecialchars($prop['val'], ENT_NOQUOTES, 'utf-8')); - // for href properties we need (minimalistic) urlencoding, eg. space - if ($prop['name'] == 'href') + // do NOT urlencode mailto href, as no clients understands them + if ($prop['name'] == 'href' && stripos($val, 'mailto:') !== 0) { $val = $this->_urlencode($val); }