summaryrefslogtreecommitdiff
path: root/it_mail.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_mail.class')
-rw-r--r--it_mail.class8
1 files changed, 4 insertions, 4 deletions
diff --git a/it_mail.class b/it_mail.class
index 73b0bd7..aa242c5 100644
--- a/it_mail.class
+++ b/it_mail.class
@@ -305,7 +305,7 @@ function send($p = array())
function header_escape($string)
{
return preg_match('/[\x00-\x1f\x7f-\xff]/', $string)
- ? ("=?{$this->charset}?Q?" . str_replace(" ", "_", preg_replace_callback('/[\x00-\x1f=\x7f-\xff]/', function($m) { return sprintf('=%02X', ord($m[0])); }, trim($string, ' "'))) . "?=")
+ ? ltrim(iconv_mime_encode('', $string, array('scheme' => 'Q', 'input-charset' => $this->charset, 'output-charset' => $this->charset)), ' :')
: $string;
}
@@ -332,12 +332,12 @@ function addrlist_escape($string)
foreach ((array)$mailboxes as $mailbox)
{
if (preg_match('/^(.*)(\s+?<[^>]+@[^>]+>\s*)$/', $mailbox, $matches))
- $result[] = $this->header_escape($matches[1]) . $matches[2];
+ $result[] = $this->header_escape(trim($matches[1])) . $matches[2];
else
- $result[] = $mailbox;
+ $result[] = trim($mailbox);
}
- return implode(',', $result);
+ return implode(', ', $result);
}