diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-06-25 06:33:10 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-06-25 06:33:10 +0000 |
| commit | 6eb103ad7fb187da173d633cdca101d223a95f97 (patch) | |
| tree | be179ddea1d195505d5bdf90ed822da0d1afe731 /roundcubemail/program/lib/Mail | |
| parent | 6b394f0a02b897506253373724653740d54ab964 (diff) | |
Patched Mail/mimePart.php (http://pear.php.net/bugs/bug.php?id=14232)
git-svn-id: https://svn.roundcube.net/trunk@1576 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/lib/Mail')
| -rw-r--r-- | roundcubemail/program/lib/Mail/mimePart.php | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/roundcubemail/program/lib/Mail/mimePart.php b/roundcubemail/program/lib/Mail/mimePart.php index bb55ba9ca..5cfdfa494 100644 --- a/roundcubemail/program/lib/Mail/mimePart.php +++ b/roundcubemail/program/lib/Mail/mimePart.php @@ -398,7 +398,7 @@ class Mail_mimePart { //is not any of the defaults, we need to encode the value. $shouldEncode = 0; $secondAsterisk = ''; - if (preg_match('#([\x80-\xFF]){1}#', $value)) { + if (preg_match('#([ \x80-\xFF \*\'\\%\t(\)\<\>\@\,\;\:\\\"/\[\]\?\=]){1}#', $value)) { $shouldEncode = 1; } elseif ($charset && (strtolower($charset) != 'us-ascii')) { $shouldEncode = 1; @@ -406,10 +406,7 @@ class Mail_mimePart { $shouldEncode = 1; } if ($shouldEncode) { - $search = array('%', ' ', "\t"); - $replace = array('%25', '%20', '%09'); - $encValue = str_replace($search, $replace, $value); - $encValue = preg_replace('#([\x80-\xFF])#e', '"%" . strtoupper(dechex(ord("\1")))', $encValue); + $encValue = preg_replace('#([\x80-\xFF \*\'\%\t\(\)\<\>\@\,\;\:\\\"/\[\]\?\=])#e', '"%" . strtoupper(dechex(ord("\1")))', $value); $value = "$charset'$language'$encValue"; $secondAsterisk = '*'; } |
