Commit bbc764ec authored by Carsten  Rose's avatar Carsten Rose

B#6109 / double tick in email subject breaks sendMail

parent 83508aa3
......@@ -44,6 +44,7 @@ class SendMail {
* @param array $mailConfig
* @throws CodeException
* @throws DbException
* @throws DownloadException
* @throws UserFormException
* @throws UserReportException
*/
......@@ -124,8 +125,9 @@ class SendMail {
if (is_array($value)) {
continue;
}
$mailConfig[$key] = Support::escapeDoubleTick($value);
// $mailConfig[$key] = addslashes($value);
if($key!=SENDMAIL_TOKEN_SUBJECT) { // do not escape double ticks in subject - this breaks the UTF8 encoding later
$mailConfig[$key] = Support::escapeDoubleTick($value);
}
}
$args[] = '-f "' . $mailConfig[SENDMAIL_TOKEN_SENDER] . '"';
......@@ -152,6 +154,8 @@ class SendMail {
$encodedSubject = iconv_mime_encode("Subject", $mailConfig[SENDMAIL_TOKEN_SUBJECT], $preferences);
$encodedSubject = substr($encodedSubject, 9); // remove 'Subject: '
$encodedSubject = Support::escapeDoubleTick($encodedSubject); // now, escape double ticks.
$args[] = '-u "' . $encodedSubject . '"';;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment