summaryrefslogtreecommitdiff
path: root/program/lib/Mail/mimePart.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-05-14 10:35:49 +0200
committerAleksander Machniak <alec@alec.pl>2014-05-14 10:38:50 +0200
commitc9feba8917a9e670ffeaa39af75b97a7a1554bf0 (patch)
tree75da85a6451ce01e6b20ef75bf80e50a8ccc0b02 /program/lib/Mail/mimePart.php
parent70ba547d109bf3a5d01f0181b8546ffafee1dc85 (diff)
Fix malformed References: header in send/saved mail (#1489891) - update Mail_mime to 1.8.9 version
Diffstat (limited to 'program/lib/Mail/mimePart.php')
-rw-r--r--program/lib/Mail/mimePart.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/program/lib/Mail/mimePart.php b/program/lib/Mail/mimePart.php
index c6e9f4aa8..93e891bc6 100644
--- a/program/lib/Mail/mimePart.php
+++ b/program/lib/Mail/mimePart.php
@@ -839,7 +839,7 @@ class Mail_mimePart
// Simple e-mail address regexp
$email_regexp = '([^\s<]+|("[^\r\n"]+"))@\S+';
- $parts = Mail_mimePart::_explodeQuotedString($separator, $value);
+ $parts = Mail_mimePart::_explodeQuotedString("[\t$separator]", $value);
$value = '';
foreach ($parts as $part) {
@@ -850,7 +850,7 @@ class Mail_mimePart
continue;
}
if ($value) {
- $value .= $separator==',' ? $separator.' ' : ' ';
+ $value .= $separator == ',' ? $separator . ' ' : ' ';
} else {
$value = $name . ': ';
}
@@ -869,7 +869,7 @@ class Mail_mimePart
// check if phrase requires quoting
if ($word) {
// non-ASCII: require encoding
- if (preg_match('#([\x80-\xFF]){1}#', $word)) {
+ if (preg_match('#([^\s\x21-\x7E]){1}#', $word)) {
if ($word[0] == '"' && $word[strlen($word)-1] == '"') {
// de-quote quoted-string, encoding changes
// string to atom
@@ -908,11 +908,10 @@ class Mail_mimePart
$value = preg_replace(
'/^'.$name.':('.preg_quote($eol, '/').')* /', '', $value
);
-
} else {
// Unstructured header
// non-ASCII: require encoding
- if (preg_match('#([\x80-\xFF]){1}#', $value)) {
+ if (preg_match('#([^\s\x21-\x7E]){1}#', $value)) {
if ($value[0] == '"' && $value[strlen($value)-1] == '"') {
// de-quote quoted-string, encoding changes
// string to atom