Fix contacts with ampersands in their name will fail in mailto function

This commit is contained in:
Hadi Nategh 2018-07-05 11:28:12 +02:00
parent 8bdf9e27f6
commit 9317cdd216
2 changed files with 3 additions and 2 deletions

View File

@ -45,7 +45,7 @@ egw.extend('open', egw.MODULE_WND_LOCAL, function(_egw, _wnd)
var hashes = uri.slice(uri.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
index = hashes[i].split('=');
index = hashes[i].replace(/__AMPERSAND__/g, '&').split('=');
match.push(index[0]);
match[index[0]] = index[1];
}

View File

@ -865,11 +865,12 @@ class mail_compose
$addRequests = explode('&',$mailtoArray[1]);
foreach ($addRequests as $key => $reqval) {
// the additional requests should have a =, to separate key from value.
$reqval = preg_replace('/__AMPERSAND__/i', "&", $reqval);
$keyValuePair = explode('=',$reqval,2);
$content[$keyValuePair[0]] .= (strlen($content[$keyValuePair[0]])>0 ? ' ':'') . $keyValuePair[1];
}
}
$content['to']=$mailtoArray[0];
$content['to']= preg_replace('/__AMPERSAND__/i', "&", $mailtoArray[0]);
$alreadyProcessed['to']='to';
// if the mailto string is not htmlentity decoded the arguments are passed as simple requests
foreach(array('cc','bcc','subject','body') as $name) {