From 7c2d30b2e106a23fe2ab295f7dc2e628e4d828bb Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Wed, 13 Aug 2008 07:39:10 -0400
Subject: [PATCH] #1485170: fixed splitter under Firefox3

---
 program/lib/Mail/mimePart.php |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/program/lib/Mail/mimePart.php b/program/lib/Mail/mimePart.php
index bb55ba9..5cfdfa4 100644
--- a/program/lib/Mail/mimePart.php
+++ b/program/lib/Mail/mimePart.php
@@ -398,7 +398,7 @@
         //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 @@
             $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 = '*';
         }

--
Gitblit v1.9.1