summaryrefslogtreecommitdiff
path: root/it_mail.class
diff options
context:
space:
mode:
authorChristian A. Weber2014-03-27 16:01:12 +0100
committerChristian A. Weber2014-03-27 16:01:12 +0100
commitffc8f17cd2cd410f83fe345370f35f18f38d4bbe (patch)
tree05844198c858ad40e6f2cebdf063485ed5c13790 /it_mail.class
parentbc10ca5de76427de58755d4c3d7044bf95d0a2ce (diff)
downloaditools-ffc8f17cd2cd410f83fe345370f35f18f38d4bbe.tar.gz
itools-ffc8f17cd2cd410f83fe345370f35f18f38d4bbe.tar.bz2
itools-ffc8f17cd2cd410f83fe345370f35f18f38d4bbe.zip
strip quotes when utf8-encoding the fullname part of an e-mail address
Diffstat (limited to 'it_mail.class')
-rw-r--r--it_mail.class2
1 files changed, 1 insertions, 1 deletions
diff --git a/it_mail.class b/it_mail.class
index e8649e9..f24a603 100644
--- a/it_mail.class
+++ b/it_mail.class
@@ -313,7 +313,7 @@ function header_escape($string, $emailmode = false)
{
# Encode if not email address and contains special chars
$result .= !preg_match($emailpattern, $part) && preg_match('/[\x00-\x1f\x7f-\xff]/', $part)
- ? ("=?{$this->charset}?Q?" . str_replace(" ", "_", preg_replace_callback('/[\x00-\x1f=\x7f-\xff]/', function($m) { return sprintf('=%02X', ord($m[0])); }, $part)) . "?=")
+ ? ("=?{$this->charset}?Q?" . str_replace(" ", "_", preg_replace_callback('/[\x00-\x1f=\x7f-\xff]/', function($m) { return sprintf('=%02X', ord($m[0])); }, trim($part, '"'))) . "?=")
: $part;
}