Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14123695
D19027.id45625.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D19027.id45625.diff
View Options
diff --git a/src/applications/metamta/adapter/PhabricatorMailImplementationAdapter.php b/src/applications/metamta/adapter/PhabricatorMailImplementationAdapter.php
--- a/src/applications/metamta/adapter/PhabricatorMailImplementationAdapter.php
+++ b/src/applications/metamta/adapter/PhabricatorMailImplementationAdapter.php
@@ -96,8 +96,9 @@
protected function renderAddress($email, $name = null) {
if (strlen($name)) {
- // TODO: This needs to be escaped correctly.
- return "{$name} <{$email}>";
+ return (string)id(new PhutilEmailAddress())
+ ->setDisplayName($name)
+ ->setAddress($email);
} else {
return $email;
}
diff --git a/src/applications/metamta/adapter/PhabricatorMailImplementationMailgunAdapter.php b/src/applications/metamta/adapter/PhabricatorMailImplementationMailgunAdapter.php
--- a/src/applications/metamta/adapter/PhabricatorMailImplementationMailgunAdapter.php
+++ b/src/applications/metamta/adapter/PhabricatorMailImplementationMailgunAdapter.php
@@ -21,7 +21,7 @@
if (empty($this->params['reply-to'])) {
$this->params['reply-to'] = array();
}
- $this->params['reply-to'][] = "{$name} <{$email}>";
+ $this->params['reply-to'][] = $this->renderAddress($name, $email);
return $this;
}
@@ -110,11 +110,8 @@
}
$from = idx($this->params, 'from');
- if (idx($this->params, 'from-name')) {
- $params['from'] = "\"{$this->params['from-name']}\" <{$from}>";
- } else {
- $params['from'] = $from;
- }
+ $from_name = idx($this->params, 'from-name');
+ $params['from'] = $this->renderAddress($from, $from_name);
if (idx($this->params, 'reply-to')) {
$replyto = $this->params['reply-to'];
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 30, 11:42 PM (21 h, 51 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6810877
Default Alt Text
D19027.id45625.diff (1 KB)
Attached To
Mode
D19027: Improve correctness of email address escaping in Mailgun/Postmark
Attached
Detach File
Event Timeline
Log In to Comment