トピック投稿者
k1d
(@k1d)
自己フォローです。
とりあえず、Subject: だけは継続行の処理を入れてみました。
極めてアドホックな改造なので、動作は保証できませんが…。
BEGIN — cut here —
diff -ur ORIG/wp-mail.php New/wp-mail.php
--- ORIG/wp-mail.php 2012-04-28 16:17:11.000000000 +0900
+++ New/wp-mail.php 2012-04-28 16:24:00.000000000 +0900
@@ -54,6 +54,7 @@
$message = $pop3->get($i);
$bodysignal = false;
+ $subjectsignal = false;
$boundary = '';
$charset = '';
$content = '';
@@ -69,6 +70,22 @@
if ( $bodysignal ) {
$content .= $line;
} else {
+ if (($line[0] == " ") || ($line[0] == "\t")) {
+ if ($subjectsignal == true) {
+ $subject2 = trim($line);
+ if ( function_exists('iconv_mime_decode') ) {
+ $subject2 = iconv_mime_decode($subject2, 2, get_option('blog_charset'));
+ } else {
+ $subject2 = wp_iso_descrambler($subject2);
+ }
+ $subject2 = explode($phone_delim, $subject2);
+ $subject .= $subject2[0];
+ }
+ }
+ else {
+ $subjectsignal = false;
+ }
+
if ( preg_match('/Content-Type: /i', $line) ) {
$content_type = trim($line);
$content_type = substr($content_type, 14, strlen($content_type) - 14);
@@ -91,6 +108,7 @@
$boundary = $boundary[1];
}
if (preg_match('/Subject: /i', $line)) {
+ $subjectsignal = true;
$subject = trim($line);
$subject = substr($subject, 9, strlen($subject) - 9);
// Captures any text in the subject before $phone_delim as the subject
END –cut here —