summaryrefslogtreecommitdiffstats
path: root/wp-mail.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-05-21 18:37:58 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-05-21 18:37:58 +0000
commit89fe0ff804e7c6497ebacc8b341ac89974f6f255 (patch)
tree3fce310b29c685008fdbb75c5ab531bc3a6ae12a /wp-mail.php
parenta139071806ba941346a109fbefb2d5f22bae1cc4 (diff)
downloadwordpress-mu-89fe0ff804e7c6497ebacc8b341ac89974f6f255.tar.gz
wordpress-mu-89fe0ff804e7c6497ebacc8b341ac89974f6f255.tar.xz
wordpress-mu-89fe0ff804e7c6497ebacc8b341ac89974f6f255.zip
WP Merge to rev 5499, this is a big one! Test it before you put it live!
Test only, not for production use yet git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@972 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-mail.php')
-rw-r--r--wp-mail.php19
1 files changed, 15 insertions, 4 deletions
diff --git a/wp-mail.php b/wp-mail.php
index ded37bd..8795c74 100644
--- a/wp-mail.php
+++ b/wp-mail.php
@@ -24,10 +24,10 @@ for ($i=1; $i <= $count; $i++) :
$content = '';
$content_type = '';
+ $content_transfer_encoding = '';
$boundary = '';
$bodysignal = 0;
- $dmonths = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
- 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
+ $dmonths = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
foreach ($message as $line) :
if (strlen($line) < 3) $bodysignal = 1;
@@ -40,6 +40,12 @@ for ($i=1; $i <= $count; $i++) :
$content_type = explode(';', $content_type);
$content_type = $content_type[0];
}
+ if (preg_match('/Content-Transfer-Encoding: /i', $line)) {
+ $content_transfer_encoding = trim($line);
+ $content_transfer_encoding = substr($content_transfer_encoding, 27, strlen($content_transfer_encoding)-14);
+ $content_transfer_encoding = explode(';', $content_transfer_encoding);
+ $content_transfer_encoding = $content_transfer_encoding[0];
+ }
if (($content_type == 'multipart/alternative') && (preg_match('/boundary="/', $line)) && ($boundary == '')) {
$boundary = trim($line);
$boundary = explode('"', $boundary);
@@ -56,7 +62,7 @@ for ($i=1; $i <= $count; $i++) :
// Set the author using the email address (To or Reply-To, the last used)
// otherwise use the site admin
- if (preg_match('/From: /', $line) | preg_match('Reply-To: /', $line)) {
+ if (preg_match('/From: /', $line) | preg_match('/Reply-To: /', $line)) {
$author=trim($line);
if ( ereg("([a-zA-Z0-9\_\-\.]+@[\a-zA-z0-9\_\-\.]+)", $author , $regs) ) {
$author = $regs[1];
@@ -111,11 +117,16 @@ for ($i=1; $i <= $count; $i++) :
$content = strip_tags($content[1], '<img><p><br><i><b><u><em><strong><strike><font><span><div>');
}
$content = trim($content);
+
+ if (stripos($content_transfer_encoding, "quoted-printable") !== false) {
+ $content = quoted_printable_decode($content);
+ }
+
// Captures any text in the body after $phone_delim as the body
$content = explode($phone_delim, $content);
$content[1] ? $content = $content[1] : $content = $content[0];
- echo "<p><b>Content-type:</b> $content_type, <b>boundary:</b> $boundary</p>\n";
+ echo "<p><b>Content-type:</b> $content_type, <b>Content-Transfer-Encoding:</b> $content_transfer_encoding, <b>boundary:</b> $boundary</p>\n";
echo "<p><b>Raw content:</b><br /><pre>".$content.'</pre></p>';
$content = trim($content);