summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2008-06-25 06:33:10 +0000
committeralecpl <alec@alec.pl>2008-06-25 06:33:10 +0000
commit1c25366406b19324e0419bb3e4798b6e50b37f4e (patch)
tree15f64ffb790a6e102d1efda7a48163e03eca974b
parentcdd3c96ffb59271e97a99d55651fe3a2f8566ea1 (diff)
Patched Mail/mimePart.php (http://pear.php.net/bugs/bug.php?id=14232)
-rw-r--r--CHANGELOG4
-rw-r--r--program/lib/Mail/mimePart.php7
2 files changed, 6 insertions, 5 deletions
diff --git a/CHANGELOG b/CHANGELOG
index b0ec287e3..9bde8fb7c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -3,6 +3,10 @@ CHANGELOG RoundCube Webmail
2008/06/24 (alec)
----------
+- Patched Mail/MimePart.php (http://pear.php.net/bugs/bug.php?id=14232)
+
+2008/06/24 (alec)
+----------
- Allow trash/junk subfolders to be purged (#1485085)
2008/06/20 (alec)
diff --git a/program/lib/Mail/mimePart.php b/program/lib/Mail/mimePart.php
index bb55ba9ca..5cfdfa494 100644
--- a/program/lib/Mail/mimePart.php
+++ b/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 = '*';
}