Version Description
(2017-11-10) = * Fix: remove encoding option, everything is UTF-8. * Feature: add MySQL version to debug output, suppress many email parsing debug messages * Fix: don't set actual post format if "standard" * Feature: Hides WordPress post-by-email feature if Postie is active
Download this release
Release Info
Developer | WayneAllen |
Plugin | Postie |
Version | 1.9.11 |
Comparing to | |
See all releases |
Code changes from version 1.9.10 to 1.9.11
- config_form_message.php +1 -9
- docs/Changes.txt +6 -0
- docs/Postie.txt +1 -1
- lib/fMailbox.php +36 -36
- lib/pImapMailServer.php +2 -2
- postie-config.class.php +2 -0
- postie.class.php +12 -4
- postie.php +8 -3
- readme.txt +7 -1
config_form_message.php
CHANGED
@@ -71,7 +71,7 @@
|
|
71 |
} else {
|
72 |
$formats = array();
|
73 |
}
|
74 |
-
array_unshift($formats,
|
75 |
foreach ($formats as $format) {
|
76 |
$selected = "";
|
77 |
if ($config['post_format'] == $format) {
|
@@ -155,14 +155,6 @@
|
|
155 |
<?php
|
156 |
echo PostieAdmin::boolean_select_html(__("Automatically convert urls to links", 'postie'), "postie-settings[converturls]", $converturls);
|
157 |
?>
|
158 |
-
<tr>
|
159 |
-
<th scope="row"><?php _e('Encoding for pages and feeds', 'postie') ?> </th>
|
160 |
-
<td>
|
161 |
-
<input name='postie-settings[message_encoding]' type="text" id='postie-settings-message_encoding' value="<?php echo esc_attr($message_encoding); ?>" size="10" />
|
162 |
-
<p class='description'><?php _e('The character set for your blog.', 'postie') ?></p>
|
163 |
-
<p class='description'>UTF-8 <?php _e("should handle ISO-8859-1 as well", 'postie'); ?></p>
|
164 |
-
</td>
|
165 |
-
</tr>
|
166 |
<?php echo PostieAdmin::boolean_select_html(__("Drop The Signature From Mail", 'postie'), "postie-settings[drop_signature]", $drop_signature); ?>
|
167 |
<?php echo PostieAdmin::textarea_html(__("Signature Patterns", 'postie'), "postie-settings[sig_pattern_list]", $sig_pattern_list, __("Put each pattern on a separate line. Patterns are <a href='http://regex101.com/' target='_blank'>regular expressions</a> and are put inside '/^{pattern}\s?$/miu'. For HTML content the inner text of each element is evaluated against the pattern. E.g for <p>some test</p><p>-- <br>signature</p> Postie will evaluate 'some text', '-- ' and 'signature' against the pattern(s) and the first time it find a match it will assume that is the signature and remove it and anything below it from the post.", 'postie')); ?>
|
168 |
</table>
|
71 |
} else {
|
72 |
$formats = array();
|
73 |
}
|
74 |
+
array_unshift($formats, 'standard');
|
75 |
foreach ($formats as $format) {
|
76 |
$selected = "";
|
77 |
if ($config['post_format'] == $format) {
|
155 |
<?php
|
156 |
echo PostieAdmin::boolean_select_html(__("Automatically convert urls to links", 'postie'), "postie-settings[converturls]", $converturls);
|
157 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
<?php echo PostieAdmin::boolean_select_html(__("Drop The Signature From Mail", 'postie'), "postie-settings[drop_signature]", $drop_signature); ?>
|
159 |
<?php echo PostieAdmin::textarea_html(__("Signature Patterns", 'postie'), "postie-settings[sig_pattern_list]", $sig_pattern_list, __("Put each pattern on a separate line. Patterns are <a href='http://regex101.com/' target='_blank'>regular expressions</a> and are put inside '/^{pattern}\s?$/miu'. For HTML content the inner text of each element is evaluated against the pattern. E.g for <p>some test</p><p>-- <br>signature</p> Postie will evaluate 'some text', '-- ' and 'signature' against the pattern(s) and the first time it find a match it will assume that is the signature and remove it and anything below it from the post.", 'postie')); ?>
|
160 |
</table>
|
docs/Changes.txt
CHANGED
@@ -35,6 +35,12 @@ All script, style and body tags are stripped from html emails.
|
|
35 |
Attachments are now processed in the order they were attached.
|
36 |
|
37 |
== CHANGELOG ==
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
= 1.9.10 (2017-10-31) =
|
39 |
* Fix: WP CLI compatibility
|
40 |
|
35 |
Attachments are now processed in the order they were attached.
|
36 |
|
37 |
== CHANGELOG ==
|
38 |
+
= 1.9.11 (2017-11-10) =
|
39 |
+
* Fix: remove encoding option, everything is UTF-8.
|
40 |
+
* Feature: add MySQL version to debug output, suppress many email parsing debug messages
|
41 |
+
* Fix: don't set actual post format if "standard"
|
42 |
+
* Feature: Hides WordPress post-by-email feature if Postie is active
|
43 |
+
|
44 |
= 1.9.10 (2017-10-31) =
|
45 |
* Fix: WP CLI compatibility
|
46 |
|
docs/Postie.txt
CHANGED
@@ -7,7 +7,7 @@ Tags: e-mail, email, post-by-email
|
|
7 |
Requires PHP: 5.3
|
8 |
Requires at least: 4.0
|
9 |
Tested up to: 4.8.2
|
10 |
-
Stable tag: 1.9.
|
11 |
License: GPLv2 or later
|
12 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
13 |
|
7 |
Requires PHP: 5.3
|
8 |
Requires at least: 4.0
|
9 |
Tested up to: 4.8.2
|
10 |
+
Stable tag: 1.9.11
|
11 |
License: GPLv2 or later
|
12 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
13 |
|
lib/fMailbox.php
CHANGED
@@ -100,7 +100,7 @@ class fMailbox {
|
|
100 |
* @return string The decoded UTF-8
|
101 |
*/
|
102 |
static public function decodeHeader($text) {
|
103 |
-
DebugEcho("decodeHeader: start");
|
104 |
$parts = preg_split('#(=\?[^\?]+\?[QB]\?[^\?]+\?=)#i', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
|
105 |
//DebugEcho("decodeHeader: parts");
|
106 |
//DebugDump($parts);
|
@@ -113,7 +113,7 @@ class fMailbox {
|
|
113 |
}
|
114 |
|
115 |
if (preg_match_all('#=\?([^\?]+)\?([QB])\?([^\?]+)\?=#i', $part, $matches, PREG_SET_ORDER)) {
|
116 |
-
DebugEcho("decodeHeader: found encoded value: '$part'");
|
117 |
//DebugDump($matches);
|
118 |
$islastencoded = true;
|
119 |
foreach ($matches as $match) {
|
@@ -135,7 +135,7 @@ class fMailbox {
|
|
135 |
}
|
136 |
//DebugDump($part_with_encoding);
|
137 |
} else {
|
138 |
-
DebugEcho("decodeHeader: found non-encoded value: '$part'");
|
139 |
|
140 |
if (!($islastencoded && $part == '')) {
|
141 |
$last_key = count($part_with_encoding) - 1;
|
@@ -184,7 +184,7 @@ class fMailbox {
|
|
184 |
}
|
185 |
|
186 |
if ($structure['type'] == 'application' && in_array($structure['subtype'], array('pkcs7-mime', 'x-pkcs7-mime'))) {
|
187 |
-
DebugEcho('handlePart: secure1 ' . $structure['subtype']);
|
188 |
$to = NULL;
|
189 |
if (isset($info['headers']['to'][0])) {
|
190 |
$to = $info['headers']['to'][0]['mailbox'];
|
@@ -200,7 +200,7 @@ class fMailbox {
|
|
200 |
}
|
201 |
|
202 |
if ($structure['type'] == 'application' && in_array($structure['subtype'], array('pkcs7-signature', 'x-pkcs7-signature'))) {
|
203 |
-
DebugEcho('handlePart: secure2 ' . $structure['subtype']);
|
204 |
$from = NULL;
|
205 |
if (isset($info['headers']['from'])) {
|
206 |
$from = $info['headers']['from']['mailbox'];
|
@@ -218,16 +218,16 @@ class fMailbox {
|
|
218 |
$data = $structure['data'];
|
219 |
|
220 |
if ($structure['encoding'] == 'base64') {
|
221 |
-
DebugEcho('handlePart: base64');
|
222 |
$content = '';
|
223 |
foreach (explode("\r\n", $data) as $line) {
|
224 |
$content .= base64_decode($line);
|
225 |
}
|
226 |
} elseif ($structure['encoding'] == 'quoted-printable') {
|
227 |
-
DebugEcho('handlePart: quoted-printable');
|
228 |
$content = quoted_printable_decode($data);
|
229 |
} else {
|
230 |
-
DebugEcho('handlePart: no encoding');
|
231 |
$content = $data;
|
232 |
}
|
233 |
|
@@ -238,11 +238,11 @@ class fMailbox {
|
|
238 |
//ensure the mime type is correct before doing additional decoding. Some mail clients mark all attachments as text/plain regardless of real type - looking at you outlook.com
|
239 |
foreach ($structure['disposition_fields'] as $field => $value) {
|
240 |
if (strtolower($field) == 'filename') {
|
241 |
-
DebugEcho("handlePart: disposition_fields filename: $value");
|
242 |
$filename = $value;
|
243 |
$ftype = wp_check_filetype($filename);
|
244 |
if ($ftype['type']) {
|
245 |
-
DebugEcho("handlePart: revised mimetype: {$ftype['type']}");
|
246 |
$mimes = explode('/', $ftype['type']);
|
247 |
$structure['type'] = $mimes[0];
|
248 |
$structure['subtype'] = $mimes[1];
|
@@ -252,11 +252,11 @@ class fMailbox {
|
|
252 |
}
|
253 |
foreach ($structure['type_fields'] as $field => $value) {
|
254 |
if (strtolower($field) == 'name') {
|
255 |
-
DebugEcho("handlePart: type_fields filename: $value");
|
256 |
$filename = $value;
|
257 |
$ftype = wp_check_filetype($filename);
|
258 |
if ($ftype['type']) {
|
259 |
-
DebugEcho("handlePart: revised mimetype: {$ftype['type']}");
|
260 |
$mimes = explode('/', $ftype['type']);
|
261 |
$structure['type'] = $mimes[0];
|
262 |
$structure['subtype'] = $mimes[1];
|
@@ -272,34 +272,34 @@ class fMailbox {
|
|
272 |
foreach ($structure['type_fields'] as $field => $value) {
|
273 |
if (strtolower($field) == 'charset') {
|
274 |
$charset = $value;
|
275 |
-
DebugEcho("handlePart: charset $value detected");
|
276 |
break;
|
277 |
}
|
278 |
}
|
279 |
|
280 |
if (strtolower($charset) !== 'utf-8') {
|
281 |
-
DebugEcho("handlePart: converting $charset to UTF-8");
|
282 |
$content = self::iconv($charset, 'UTF-8', $content);
|
283 |
} else {
|
284 |
-
DebugEcho("handlePart: skipping charset conversion");
|
285 |
}
|
286 |
|
287 |
if ($structure['subtype'] == 'html') {
|
288 |
-
DebugEcho("handlePart: fixing up html");
|
289 |
$content = preg_replace('#(content=(["\'])text/html\s*;\s*charset=(["\']?))' . preg_quote($charset, '#') . '(\3\2)#i', '\1utf-8\4', $content);
|
290 |
}
|
291 |
-
DebugEcho("handlePart: text length: " . strlen($content));
|
292 |
//DebugDump($content);
|
293 |
}
|
294 |
|
295 |
// This indicates a content-id which is used for multipart/related
|
296 |
if ($structure['content_id'] && $structure['type'] != 'text') {
|
297 |
-
DebugEcho('handlePart: multipart/related: ' . $structure['content_id']);
|
298 |
if (!isset($info['related'])) {
|
299 |
$info['related'] = array();
|
300 |
}
|
301 |
$cid = $structure['content_id'][0] == '<' ? substr($structure['content_id'], 1, -1) : $structure['content_id'];
|
302 |
-
DebugEcho("handlePart: cid: $cid ($filename) {$structure['type']}/{$structure['subtype']}");
|
303 |
$info['related']['cid:' . $cid] = array(
|
304 |
'filename' => $filename,
|
305 |
'mimetype' => $structure['type'] . '/' . $structure['subtype'],
|
@@ -328,46 +328,46 @@ class fMailbox {
|
|
328 |
|
329 |
// Attachments or inline content
|
330 |
if ($has_disposition) {
|
331 |
-
DebugEcho("handlePart: disposition set to " . $structure['disposition']);
|
332 |
|
333 |
// This automatically handles primary content that has a content-disposition header on it
|
334 |
if ($structure['disposition'] == 'inline' && $filename === '') {
|
335 |
-
DebugEcho("handlePart: inline un-named");
|
336 |
|
337 |
if ($is_text) {
|
338 |
if (empty($info['text'])) {
|
339 |
-
DebugEcho("handlePart: text (first time)");
|
340 |
$info['text'] = $content;
|
341 |
return $info;
|
342 |
} else {
|
343 |
-
DebugEcho("handlePart: text (nth time)");
|
344 |
$info['text'] .= "\r\n$content";
|
345 |
return $info;
|
346 |
}
|
347 |
} else {
|
348 |
-
DebugEcho("handlePart: not text");
|
349 |
}
|
350 |
|
351 |
if ($is_html && empty($info['html'])) {
|
352 |
-
DebugEcho("handlePart: html");
|
353 |
$info['html'] = $content;
|
354 |
return $info;
|
355 |
} else {
|
356 |
-
DebugEcho("handlePart: not html");
|
357 |
}
|
358 |
}
|
359 |
|
360 |
if ($structure['disposition'] == 'inline' && $structure['type'] == 'image') {
|
361 |
-
DebugEcho("handlePart: inline image");
|
362 |
$info['text'] .= "<:inline $filename inline:>";
|
363 |
}
|
364 |
|
365 |
if (!isset($info[$structure['disposition']])) {
|
366 |
-
DebugEcho("handlePart: blank disposition");
|
367 |
$info[$structure['disposition']] = array();
|
368 |
}
|
369 |
|
370 |
-
DebugEcho("handlePart: disposition: '$filename' {$structure['type']}/{$structure['subtype']}");
|
371 |
$info[$structure['disposition']][] = array(
|
372 |
'filename' => $filename,
|
373 |
'mimetype' => $structure['type'] . '/' . $structure['subtype'],
|
@@ -375,17 +375,17 @@ class fMailbox {
|
|
375 |
);
|
376 |
return $info;
|
377 |
} else {
|
378 |
-
DebugEcho("handlePart: no disposition set");
|
379 |
}
|
380 |
|
381 |
if ($is_text) {
|
382 |
-
DebugEcho("handlePart: text extracted");
|
383 |
$info['text'] = $content;
|
384 |
return $info;
|
385 |
}
|
386 |
|
387 |
if ($is_html) {
|
388 |
-
DebugEcho("handlePart: html extracted");
|
389 |
$info['html'] = $content;
|
390 |
return $info;
|
391 |
}
|
@@ -484,7 +484,7 @@ class fMailbox {
|
|
484 |
static private function iconv($in_charset, $out_charset, $string) {
|
485 |
$s = iconv($in_charset, "$out_charset//IGNORE", $string);
|
486 |
if ($s === false) {
|
487 |
-
EchoError("iconv: error converting character set");
|
488 |
return $string;
|
489 |
} else {
|
490 |
return self::remove_utf8_bom($s);
|
@@ -566,7 +566,7 @@ class fMailbox {
|
|
566 |
|
567 |
$headers = array();
|
568 |
foreach ($header_lines as $header_line) {
|
569 |
-
DebugEcho("headerline: $header_line");
|
570 |
$header_line = preg_replace("#\r\n\s+#", ' ', $header_line);
|
571 |
|
572 |
if (false !== strpos($header_line, ':')) {
|
@@ -773,8 +773,8 @@ class fMailbox {
|
|
773 |
$headers = self::parseHeaders($headers);
|
774 |
}
|
775 |
|
776 |
-
DebugEcho('parseStructure: headers');
|
777 |
-
DebugDump($headers);
|
778 |
|
779 |
if (!isset($headers['content-type'])) {
|
780 |
$headers['content-type'] = array(
|
100 |
* @return string The decoded UTF-8
|
101 |
*/
|
102 |
static public function decodeHeader($text) {
|
103 |
+
//DebugEcho("decodeHeader: start");
|
104 |
$parts = preg_split('#(=\?[^\?]+\?[QB]\?[^\?]+\?=)#i', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
|
105 |
//DebugEcho("decodeHeader: parts");
|
106 |
//DebugDump($parts);
|
113 |
}
|
114 |
|
115 |
if (preg_match_all('#=\?([^\?]+)\?([QB])\?([^\?]+)\?=#i', $part, $matches, PREG_SET_ORDER)) {
|
116 |
+
//DebugEcho("decodeHeader: found encoded value: '$part'");
|
117 |
//DebugDump($matches);
|
118 |
$islastencoded = true;
|
119 |
foreach ($matches as $match) {
|
135 |
}
|
136 |
//DebugDump($part_with_encoding);
|
137 |
} else {
|
138 |
+
//DebugEcho("decodeHeader: found non-encoded value: '$part'");
|
139 |
|
140 |
if (!($islastencoded && $part == '')) {
|
141 |
$last_key = count($part_with_encoding) - 1;
|
184 |
}
|
185 |
|
186 |
if ($structure['type'] == 'application' && in_array($structure['subtype'], array('pkcs7-mime', 'x-pkcs7-mime'))) {
|
187 |
+
//DebugEcho('handlePart: secure1 ' . $structure['subtype']);
|
188 |
$to = NULL;
|
189 |
if (isset($info['headers']['to'][0])) {
|
190 |
$to = $info['headers']['to'][0]['mailbox'];
|
200 |
}
|
201 |
|
202 |
if ($structure['type'] == 'application' && in_array($structure['subtype'], array('pkcs7-signature', 'x-pkcs7-signature'))) {
|
203 |
+
//DebugEcho('handlePart: secure2 ' . $structure['subtype']);
|
204 |
$from = NULL;
|
205 |
if (isset($info['headers']['from'])) {
|
206 |
$from = $info['headers']['from']['mailbox'];
|
218 |
$data = $structure['data'];
|
219 |
|
220 |
if ($structure['encoding'] == 'base64') {
|
221 |
+
//DebugEcho('handlePart: base64');
|
222 |
$content = '';
|
223 |
foreach (explode("\r\n", $data) as $line) {
|
224 |
$content .= base64_decode($line);
|
225 |
}
|
226 |
} elseif ($structure['encoding'] == 'quoted-printable') {
|
227 |
+
//DebugEcho('handlePart: quoted-printable');
|
228 |
$content = quoted_printable_decode($data);
|
229 |
} else {
|
230 |
+
//DebugEcho('handlePart: no encoding');
|
231 |
$content = $data;
|
232 |
}
|
233 |
|
238 |
//ensure the mime type is correct before doing additional decoding. Some mail clients mark all attachments as text/plain regardless of real type - looking at you outlook.com
|
239 |
foreach ($structure['disposition_fields'] as $field => $value) {
|
240 |
if (strtolower($field) == 'filename') {
|
241 |
+
//DebugEcho("handlePart: disposition_fields filename: $value");
|
242 |
$filename = $value;
|
243 |
$ftype = wp_check_filetype($filename);
|
244 |
if ($ftype['type']) {
|
245 |
+
//DebugEcho("handlePart: revised mimetype: {$ftype['type']}");
|
246 |
$mimes = explode('/', $ftype['type']);
|
247 |
$structure['type'] = $mimes[0];
|
248 |
$structure['subtype'] = $mimes[1];
|
252 |
}
|
253 |
foreach ($structure['type_fields'] as $field => $value) {
|
254 |
if (strtolower($field) == 'name') {
|
255 |
+
//DebugEcho("handlePart: type_fields filename: $value");
|
256 |
$filename = $value;
|
257 |
$ftype = wp_check_filetype($filename);
|
258 |
if ($ftype['type']) {
|
259 |
+
//DebugEcho("handlePart: revised mimetype: {$ftype['type']}");
|
260 |
$mimes = explode('/', $ftype['type']);
|
261 |
$structure['type'] = $mimes[0];
|
262 |
$structure['subtype'] = $mimes[1];
|
272 |
foreach ($structure['type_fields'] as $field => $value) {
|
273 |
if (strtolower($field) == 'charset') {
|
274 |
$charset = $value;
|
275 |
+
//DebugEcho("handlePart: charset $value detected");
|
276 |
break;
|
277 |
}
|
278 |
}
|
279 |
|
280 |
if (strtolower($charset) !== 'utf-8') {
|
281 |
+
//DebugEcho("handlePart: converting $charset to UTF-8");
|
282 |
$content = self::iconv($charset, 'UTF-8', $content);
|
283 |
} else {
|
284 |
+
//DebugEcho("handlePart: skipping charset conversion");
|
285 |
}
|
286 |
|
287 |
if ($structure['subtype'] == 'html') {
|
288 |
+
//DebugEcho("handlePart: fixing up html");
|
289 |
$content = preg_replace('#(content=(["\'])text/html\s*;\s*charset=(["\']?))' . preg_quote($charset, '#') . '(\3\2)#i', '\1utf-8\4', $content);
|
290 |
}
|
291 |
+
//DebugEcho("handlePart: text length: " . strlen($content));
|
292 |
//DebugDump($content);
|
293 |
}
|
294 |
|
295 |
// This indicates a content-id which is used for multipart/related
|
296 |
if ($structure['content_id'] && $structure['type'] != 'text') {
|
297 |
+
//DebugEcho('handlePart: multipart/related: ' . $structure['content_id']);
|
298 |
if (!isset($info['related'])) {
|
299 |
$info['related'] = array();
|
300 |
}
|
301 |
$cid = $structure['content_id'][0] == '<' ? substr($structure['content_id'], 1, -1) : $structure['content_id'];
|
302 |
+
//DebugEcho("handlePart: cid: $cid ($filename) {$structure['type']}/{$structure['subtype']}");
|
303 |
$info['related']['cid:' . $cid] = array(
|
304 |
'filename' => $filename,
|
305 |
'mimetype' => $structure['type'] . '/' . $structure['subtype'],
|
328 |
|
329 |
// Attachments or inline content
|
330 |
if ($has_disposition) {
|
331 |
+
//DebugEcho("handlePart: disposition set to " . $structure['disposition']);
|
332 |
|
333 |
// This automatically handles primary content that has a content-disposition header on it
|
334 |
if ($structure['disposition'] == 'inline' && $filename === '') {
|
335 |
+
//DebugEcho("handlePart: inline un-named");
|
336 |
|
337 |
if ($is_text) {
|
338 |
if (empty($info['text'])) {
|
339 |
+
//DebugEcho("handlePart: text (first time)");
|
340 |
$info['text'] = $content;
|
341 |
return $info;
|
342 |
} else {
|
343 |
+
//DebugEcho("handlePart: text (nth time)");
|
344 |
$info['text'] .= "\r\n$content";
|
345 |
return $info;
|
346 |
}
|
347 |
} else {
|
348 |
+
//DebugEcho("handlePart: not text");
|
349 |
}
|
350 |
|
351 |
if ($is_html && empty($info['html'])) {
|
352 |
+
//DebugEcho("handlePart: html");
|
353 |
$info['html'] = $content;
|
354 |
return $info;
|
355 |
} else {
|
356 |
+
//DebugEcho("handlePart: not html");
|
357 |
}
|
358 |
}
|
359 |
|
360 |
if ($structure['disposition'] == 'inline' && $structure['type'] == 'image') {
|
361 |
+
//DebugEcho("handlePart: inline image");
|
362 |
$info['text'] .= "<:inline $filename inline:>";
|
363 |
}
|
364 |
|
365 |
if (!isset($info[$structure['disposition']])) {
|
366 |
+
//DebugEcho("handlePart: blank disposition");
|
367 |
$info[$structure['disposition']] = array();
|
368 |
}
|
369 |
|
370 |
+
//DebugEcho("handlePart: disposition: '$filename' {$structure['type']}/{$structure['subtype']}");
|
371 |
$info[$structure['disposition']][] = array(
|
372 |
'filename' => $filename,
|
373 |
'mimetype' => $structure['type'] . '/' . $structure['subtype'],
|
375 |
);
|
376 |
return $info;
|
377 |
} else {
|
378 |
+
//DebugEcho("handlePart: no disposition set");
|
379 |
}
|
380 |
|
381 |
if ($is_text) {
|
382 |
+
//DebugEcho("handlePart: text extracted");
|
383 |
$info['text'] = $content;
|
384 |
return $info;
|
385 |
}
|
386 |
|
387 |
if ($is_html) {
|
388 |
+
//DebugEcho("handlePart: html extracted");
|
389 |
$info['html'] = $content;
|
390 |
return $info;
|
391 |
}
|
484 |
static private function iconv($in_charset, $out_charset, $string) {
|
485 |
$s = iconv($in_charset, "$out_charset//IGNORE", $string);
|
486 |
if ($s === false) {
|
487 |
+
EchoError("iconv: error converting from character set $in_charset to $out_charset");
|
488 |
return $string;
|
489 |
} else {
|
490 |
return self::remove_utf8_bom($s);
|
566 |
|
567 |
$headers = array();
|
568 |
foreach ($header_lines as $header_line) {
|
569 |
+
//DebugEcho("headerline: $header_line");
|
570 |
$header_line = preg_replace("#\r\n\s+#", ' ', $header_line);
|
571 |
|
572 |
if (false !== strpos($header_line, ':')) {
|
773 |
$headers = self::parseHeaders($headers);
|
774 |
}
|
775 |
|
776 |
+
//DebugEcho('parseStructure: headers');
|
777 |
+
//DebugDump($headers);
|
778 |
|
779 |
if (!isset($headers['content-type'])) {
|
780 |
$headers['content-type'] = array(
|
lib/pImapMailServer.php
CHANGED
@@ -142,10 +142,10 @@ class pImapMailServer extends pMailServer {
|
|
142 |
$mline = '';
|
143 |
$response = $this->connection->write('FETCH ' . $start . ':' . $end . ' (UID INTERNALDATE RFC822.SIZE)');
|
144 |
foreach ($response as $line) {
|
145 |
-
DebugEcho("listMessages: line: '$line'");
|
146 |
$mline = $line;
|
147 |
if (preg_match('#^\s*\*\s+(\d+)\s+FETCH\s+\((.*)\)\s*$#', $mline, $match)) {
|
148 |
-
DebugEcho("listMessages: found: $match[2]");
|
149 |
$details = self::parseResponse($match[2], TRUE);
|
150 |
$info = array();
|
151 |
|
142 |
$mline = '';
|
143 |
$response = $this->connection->write('FETCH ' . $start . ':' . $end . ' (UID INTERNALDATE RFC822.SIZE)');
|
144 |
foreach ($response as $line) {
|
145 |
+
//DebugEcho("listMessages: line: '$line'");
|
146 |
$mline = $line;
|
147 |
if (preg_match('#^\s*\*\s+(\d+)\s+FETCH\s+\((.*)\)\s*$#', $mline, $match)) {
|
148 |
+
//DebugEcho("listMessages: found: $match[2]");
|
149 |
$details = self::parseResponse($match[2], TRUE);
|
150 |
$info = array();
|
151 |
|
postie-config.class.php
CHANGED
@@ -62,6 +62,8 @@ class PostieConfig {
|
|
62 |
}
|
63 |
}
|
64 |
|
|
|
|
|
65 |
$this->fix_permission_cron($out);
|
66 |
return $out;
|
67 |
}
|
62 |
}
|
63 |
}
|
64 |
|
65 |
+
$out['message_encoding'] = 'UTF-8'; //force to UTF-8;
|
66 |
+
|
67 |
$this->fix_permission_cron($out);
|
68 |
return $out;
|
69 |
}
|
postie.class.php
CHANGED
@@ -592,7 +592,7 @@ class Postie {
|
|
592 |
}
|
593 |
if (!$config['allow_html_in_subject']) {
|
594 |
DebugEcho("get_subject: subject before htmlentities: $subject");
|
595 |
-
$subject = htmlentities($subject, ENT_COMPAT
|
596 |
DebugEcho("get_subject: subject after htmlentities: $subject");
|
597 |
}
|
598 |
|
@@ -821,8 +821,12 @@ class Postie {
|
|
821 |
'post_status' => $post_status
|
822 |
);
|
823 |
|
824 |
-
//need to
|
825 |
-
|
|
|
|
|
|
|
|
|
826 |
|
827 |
return $details;
|
828 |
}
|
@@ -1475,6 +1479,10 @@ class Postie {
|
|
1475 |
DebugEcho("PHP cURL version: " . $cv['version'], $force_display);
|
1476 |
}
|
1477 |
|
|
|
|
|
|
|
|
|
1478 |
DebugEcho("WordPress Version: " . get_bloginfo('version'), $force_display);
|
1479 |
if (defined('MULTISITE') && MULTISITE) {
|
1480 |
DebugEcho("WordPress Multisite", $force_display);
|
@@ -1664,7 +1672,7 @@ class Postie {
|
|
1664 |
}
|
1665 |
|
1666 |
DebugEcho("WordPress encoding: " . esc_attr(get_option('blog_charset')), true);
|
1667 |
-
DebugEcho("Postie encoding: " . $config['message_encoding'], true);
|
1668 |
?>
|
1669 |
<h2>Images</h2>
|
1670 |
<?php
|
592 |
}
|
593 |
if (!$config['allow_html_in_subject']) {
|
594 |
DebugEcho("get_subject: subject before htmlentities: $subject");
|
595 |
+
$subject = htmlentities($subject, ENT_COMPAT);
|
596 |
DebugEcho("get_subject: subject after htmlentities: $subject");
|
597 |
}
|
598 |
|
821 |
'post_status' => $post_status
|
822 |
);
|
823 |
|
824 |
+
//don't need to specify the post format to get a "standard" post
|
825 |
+
if ($post_type_format['post_format'] !== 'standard') {
|
826 |
+
//need to set post format differently since it is a type of taxonomy
|
827 |
+
DebugEcho("Setting post format to {$post_type_format['post_format']}");
|
828 |
+
wp_set_post_terms($post_id, $post_type_format['post_format'], 'post_format');
|
829 |
+
}
|
830 |
|
831 |
return $details;
|
832 |
}
|
1479 |
DebugEcho("PHP cURL version: " . $cv['version'], $force_display);
|
1480 |
}
|
1481 |
|
1482 |
+
$connection = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
|
1483 |
+
$dbversion = mysqli_get_server_info($connection);
|
1484 |
+
DebugEcho("MySQL Version: $dbversion", $force_display);
|
1485 |
+
|
1486 |
DebugEcho("WordPress Version: " . get_bloginfo('version'), $force_display);
|
1487 |
if (defined('MULTISITE') && MULTISITE) {
|
1488 |
DebugEcho("WordPress Multisite", $force_display);
|
1672 |
}
|
1673 |
|
1674 |
DebugEcho("WordPress encoding: " . esc_attr(get_option('blog_charset')), true);
|
1675 |
+
//DebugEcho("Postie encoding: " . $config['message_encoding'], true);
|
1676 |
?>
|
1677 |
<h2>Images</h2>
|
1678 |
<?php
|
postie.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: Postie
|
5 |
Plugin URI: http://PostiePlugin.com/
|
6 |
Description: Create posts via email. Significantly upgrades the Post by Email features of WordPress.
|
7 |
-
Version: 1.9.
|
8 |
Author: Wayne Allen
|
9 |
Author URI: http://PostiePlugin.com/
|
10 |
License: GPL3
|
@@ -28,14 +28,14 @@
|
|
28 |
*/
|
29 |
|
30 |
/*
|
31 |
-
$Id: postie.php
|
32 |
*/
|
33 |
|
34 |
if (!defined('WPINC')) {
|
35 |
die; // Exit if accessed directly
|
36 |
}
|
37 |
|
38 |
-
define('POSTIE_VERSION', '1.9.
|
39 |
define('POSTIE_ROOT', dirname(__FILE__));
|
40 |
define('POSTIE_URL', WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
|
41 |
|
@@ -61,6 +61,7 @@ if (!class_exists('PostieInit')) {
|
|
61 |
add_filter('query_vars', array($this, 'query_vars_filter'));
|
62 |
add_filter("plugin_action_links_" . plugin_basename(__FILE__), array($this, 'plugin_action_links_filter'));
|
63 |
add_filter('plugin_row_meta', array($this, 'plugin_row_meta_filter'), 10, 2);
|
|
|
64 |
|
65 |
//WordPress Hooks
|
66 |
register_activation_hook(__FILE__, array('PostieInit', 'postie_activate_hook'));
|
@@ -127,6 +128,10 @@ if (!class_exists('PostieInit')) {
|
|
127 |
remove_filter('content_save_pre', 'wp_filter_post_kses');
|
128 |
}
|
129 |
|
|
|
|
|
|
|
|
|
130 |
function plugin_row_meta_filter($links, $file) {
|
131 |
if (strpos($file, plugin_basename(__FILE__)) !== false) {
|
132 |
$new_links = array(
|
4 |
Plugin Name: Postie
|
5 |
Plugin URI: http://PostiePlugin.com/
|
6 |
Description: Create posts via email. Significantly upgrades the Post by Email features of WordPress.
|
7 |
+
Version: 1.9.11
|
8 |
Author: Wayne Allen
|
9 |
Author URI: http://PostiePlugin.com/
|
10 |
License: GPL3
|
28 |
*/
|
29 |
|
30 |
/*
|
31 |
+
$Id: postie.php 1763350 2017-11-10 21:05:09Z WayneAllen $
|
32 |
*/
|
33 |
|
34 |
if (!defined('WPINC')) {
|
35 |
die; // Exit if accessed directly
|
36 |
}
|
37 |
|
38 |
+
define('POSTIE_VERSION', '1.9.11');
|
39 |
define('POSTIE_ROOT', dirname(__FILE__));
|
40 |
define('POSTIE_URL', WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
|
41 |
|
61 |
add_filter('query_vars', array($this, 'query_vars_filter'));
|
62 |
add_filter("plugin_action_links_" . plugin_basename(__FILE__), array($this, 'plugin_action_links_filter'));
|
63 |
add_filter('plugin_row_meta', array($this, 'plugin_row_meta_filter'), 10, 2);
|
64 |
+
add_filter('enable_post_by_email_configuration', array($this, 'enable_post_by_email_configuration'));
|
65 |
|
66 |
//WordPress Hooks
|
67 |
register_activation_hook(__FILE__, array('PostieInit', 'postie_activate_hook'));
|
128 |
remove_filter('content_save_pre', 'wp_filter_post_kses');
|
129 |
}
|
130 |
|
131 |
+
function enable_post_by_email_configuration($enabled) {
|
132 |
+
return false;
|
133 |
+
}
|
134 |
+
|
135 |
function plugin_row_meta_filter($links, $file) {
|
136 |
if (strpos($file, plugin_basename(__FILE__)) !== false) {
|
137 |
$new_links = array(
|
readme.txt
CHANGED
@@ -7,7 +7,7 @@ Tags: e-mail, email, post-by-email
|
|
7 |
Requires PHP: 5.3
|
8 |
Requires at least: 4.0
|
9 |
Tested up to: 4.8.2
|
10 |
-
Stable tag: 1.9.
|
11 |
License: GPLv2 or later
|
12 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
13 |
|
@@ -243,6 +243,12 @@ All script, style and body tags are stripped from html emails.
|
|
243 |
Attachments are now processed in the order they were attached.
|
244 |
|
245 |
== CHANGELOG ==
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
= 1.9.10 (2017-10-31) =
|
247 |
* Fix: WP CLI compatibility
|
248 |
|
7 |
Requires PHP: 5.3
|
8 |
Requires at least: 4.0
|
9 |
Tested up to: 4.8.2
|
10 |
+
Stable tag: 1.9.11
|
11 |
License: GPLv2 or later
|
12 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
13 |
|
243 |
Attachments are now processed in the order they were attached.
|
244 |
|
245 |
== CHANGELOG ==
|
246 |
+
= 1.9.11 (2017-11-10) =
|
247 |
+
* Fix: remove encoding option, everything is UTF-8.
|
248 |
+
* Feature: add MySQL version to debug output, suppress many email parsing debug messages
|
249 |
+
* Fix: don't set actual post format if "standard"
|
250 |
+
* Feature: Hides WordPress post-by-email feature if Postie is active
|
251 |
+
|
252 |
= 1.9.10 (2017-10-31) =
|
253 |
* Fix: WP CLI compatibility
|
254 |
|