Ticket #6788: wp-mail.php.patch
File wp-mail.php.patch, 2.2 KB (added by , 17 years ago) |
---|
-
wp-mail.php
old new 29 29 30 30 $content = ''; 31 31 $content_type = ''; 32 $content_type_charset = ''; 32 33 $content_transfer_encoding = ''; 33 34 $boundary = ''; 34 35 $bodysignal = 0; … … 42 43 $content .= $line; 43 44 } else { 44 45 if (preg_match('/Content-Type: /i', $line)) { 46 echo "content-type-line: $line<br>"; 45 47 $content_type = trim($line); 46 48 $content_type = substr($content_type, 14, strlen($content_type)-14); 47 49 $content_type = explode(';', $content_type); 50 for ( $ctp = 1 ; $ctp < count($content_type) ; $ctp++ ) { 51 $candidate = $content_type[$ctp]; 52 echo "candidate: $candidate<br>"; 53 if ( preg_match('/charset=/i', $candidate) ) { 54 $content_type_charset=explode('=', $candidate); 55 $content_type_charset=$content_type_charset[1]; 56 $content_type_charset=trim($content_type_charset); 57 } 58 } 48 59 $content_type = $content_type[0]; 60 echo "content-type: $content_type<br>content-type-charset: '$content_type_charset'<br>"; 49 61 } 50 62 if (preg_match('/Content-Transfer-Encoding: /i', $line)) { 51 63 $content_transfer_encoding = trim($line); … … 61 73 if (preg_match('/Subject: /i', $line)) { 62 74 $subject = trim($line); 63 75 $subject = substr($subject, 9, strlen($subject)-9); 64 $subject = wp_iso_descrambler($subject); 65 // Captures any text in the subject before $phone_delim as the subject 76 // $subject = wp_iso_descrambler($subject); 77 $subject = iconv_mime_decode($subject,2,'utf8'); 78 // Captures any text in the subject before $phone_delim as the subject 66 79 $subject = explode($phone_delim, $subject); 67 80 $subject = $subject[0]; 68 81 } … … 148 161 $content = quoted_printable_decode($content); 149 162 } 150 163 164 if (strlen($content_type_charset)) { 165 echo "converting '$content_type_charset' to 'utf8'<br>"; 166 echo "content before: $content<br>"; 167 $content = iconv($content_type_charset,'utf8',$content); 168 echo "content after: $content<br>"; 169 } 170 151 171 // Captures any text in the body after $phone_delim as the body 152 172 $content = explode($phone_delim, $content); 153 173 $content[1] ? $content = $content[1] : $content = $content[0];