Postie - Version 1.9.17

Version Description

(2018-03-12) = * Fix: Plain text with < > being processed as html causing loss of content during signature removal

Download this release

Release Info

Developer WayneAllen
Plugin Icon 128x128 Postie
Version 1.9.17
Comparing to
See all releases

Code changes from version 1.9.16 to 1.9.17

docs/Changes.txt CHANGED
@@ -35,6 +35,9 @@ 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.16 (2018-02-21) =
39
  * Fix: don't linkify URLs in style attributes
40
 
35
  Attachments are now processed in the order they were attached.
36
 
37
  == CHANGELOG ==
38
+ = 1.9.17 (2018-03-12) =
39
+ * Fix: Plain text with < > being processed as html causing loss of content during signature removal
40
+
41
  = 1.9.16 (2018-02-21) =
42
  * Fix: don't linkify URLs in style attributes
43
 
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.9
10
- Stable tag: 1.9.16
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.9
10
+ Stable tag: 1.9.17
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
docs/TODO.txt CHANGED
@@ -3,13 +3,13 @@ Header/footer stripper - user provides "selector" (xpath) to identify header/foo
3
  selector = "div.footer" (div with the class "footer")
4
  May need to remove parent (or granparent of element)
5
  How to help non-techies build the selector?
6
- CSS Inliner - use one of the online services to convert class styled html to inline styles. https://www.google.com/search?q=css+inline+tool&oq=css+inline+tool
7
  Email notifications - use postie_email_* filters and some new settings panels along with some templating. User can select which post status fire the email.
8
  Configurable message for "post confirmation" - variable substitution, by post status
9
 
10
  Bugs
11
  #img# caption feature not working
12
  Comment not being created when subject contains category command []. I.e. listserv subject lines
 
13
 
14
  Other
15
  Process single email at a time and don't delete unless successful
3
  selector = "div.footer" (div with the class "footer")
4
  May need to remove parent (or granparent of element)
5
  How to help non-techies build the selector?
 
6
  Email notifications - use postie_email_* filters and some new settings panels along with some templating. User can select which post status fire the email.
7
  Configurable message for "post confirmation" - variable substitution, by post status
8
 
9
  Bugs
10
  #img# caption feature not working
11
  Comment not being created when subject contains category command []. I.e. listserv subject lines
12
+ Comment not being created when subject contains fomat or type. I.e. re: image//Image subject
13
 
14
  Other
15
  Process single email at a time and don't delete unless successful
postie-filters.php CHANGED
@@ -203,11 +203,13 @@ function filter_RemoveSignature($content, $config) {
203
  DebugEcho("filter_RemoveSignature: pattern: $pattern");
204
 
205
  $html = $g_postie->load_html($content);
206
- if ($html !== false) {
 
207
  filter_RemoveSignatureWorker($html->root, $pattern);
 
208
  $content = $html->save();
209
  } else {
210
- DebugEcho("filter_RemoveSignature: non-html");
211
  $arrcontent = explode("\n", $content);
212
  $strcontent = '';
213
 
@@ -218,7 +220,7 @@ function filter_RemoveSignature($content, $config) {
218
  break;
219
  }
220
 
221
- DebugEcho("filter_RemoveSignature: keeping '$line'");
222
  $strcontent .= $line;
223
  }
224
  $content = $strcontent;
@@ -234,7 +236,7 @@ function filter_RemoveSignatureWorker(&$html, $pattern) {
234
  $matches = array();
235
  if (preg_match($pattern, trim($html->plaintext), $matches)) {
236
  $sig = trim($matches[1]);
237
- DebugEcho("filter_RemoveSignatureWorker: signature '$sig' found in:\n" . trim($html->plaintext));
238
  //DebugDump($matches);
239
  $found = true;
240
  $i = stripos($html->innertext, $sig);
@@ -247,7 +249,7 @@ function filter_RemoveSignatureWorker(&$html, $pattern) {
247
  DebugEcho("filter_RemoveSignatureWorker: signature not found: '$sig' " . strlen($sig));
248
  }
249
  } else {
250
- DebugEcho("filter_RemoveSignatureWorker: no matches " . preg_last_error() . " '$pattern' $html->plaintext");
251
  //DebugDump($matches);
252
  }
253
 
203
  DebugEcho("filter_RemoveSignature: pattern: $pattern");
204
 
205
  $html = $g_postie->load_html($content);
206
+ if ($html !== false && $config['prefer_text_type'] == 'html') {
207
+ DebugEcho("filter_RemoveSignature: html");
208
  filter_RemoveSignatureWorker($html->root, $pattern);
209
+ //DebugEcho("filter_RemoveSignature: post worker: $html");
210
  $content = $html->save();
211
  } else {
212
+ DebugEcho("filter_RemoveSignature: plain");
213
  $arrcontent = explode("\n", $content);
214
  $strcontent = '';
215
 
220
  break;
221
  }
222
 
223
+ //DebugEcho("filter_RemoveSignature: keeping '$line'");
224
  $strcontent .= $line;
225
  }
226
  $content = $strcontent;
236
  $matches = array();
237
  if (preg_match($pattern, trim($html->plaintext), $matches)) {
238
  $sig = trim($matches[1]);
239
+ DebugEcho("filter_RemoveSignatureWorker: signature '$sig' found in:\n" . trim($html));
240
  //DebugDump($matches);
241
  $found = true;
242
  $i = stripos($html->innertext, $sig);
249
  DebugEcho("filter_RemoveSignatureWorker: signature not found: '$sig' " . strlen($sig));
250
  }
251
  } else {
252
+ DebugEcho("filter_RemoveSignatureWorker: no matches " . preg_last_error() . " '$pattern' $html");
253
  //DebugDump($matches);
254
  }
255
 
postie.class.php CHANGED
@@ -532,12 +532,13 @@ class Postie {
532
  'error' => 0,
533
  'size' => filesize($tmpFile)
534
  );
535
- DebugEcho("media_handle_upload: adding " . $file_array['name']);
536
  DebugDump($file_array);
537
 
538
  DebugEcho("doing postie_file_added_pre");
539
  do_action('postie_file_added_pre', $post_id, $file_array);
540
 
 
 
541
  $id = media_handle_sideload($file_array, $post_id);
542
 
543
  if (!is_wp_error($id)) {
@@ -1069,10 +1070,12 @@ class Postie {
1069
  $mailbox = new fMailbox($type, $conn, $srv);
1070
  $messages = $mailbox->listMessages($maxemails);
1071
 
1072
- foreach ($messages as $uid => $messages) {
1073
- DebugEcho("getemails: fetch $uid");
 
 
1074
 
1075
- $email = $mailbox->fetchMessage($uid);
1076
 
1077
  if (!empty($email['html'])) {
1078
  DebugEcho("getemails: html");
@@ -1083,8 +1086,8 @@ class Postie {
1083
 
1084
  $emails[] = $email;
1085
  if ($deleteMessages) {
1086
- DebugEcho("getemails: deleting $uid");
1087
- $mailbox->deleteMessages($uid);
1088
  }
1089
  }
1090
 
532
  'error' => 0,
533
  'size' => filesize($tmpFile)
534
  );
 
535
  DebugDump($file_array);
536
 
537
  DebugEcho("doing postie_file_added_pre");
538
  do_action('postie_file_added_pre', $post_id, $file_array);
539
 
540
+ DebugEcho("media_handle_upload: adding " . $file_array['name']);
541
+
542
  $id = media_handle_sideload($file_array, $post_id);
543
 
544
  if (!is_wp_error($id)) {
1070
  $mailbox = new fMailbox($type, $conn, $srv);
1071
  $messages = $mailbox->listMessages($maxemails);
1072
 
1073
+ DebugDump($messages);
1074
+
1075
+ foreach ($messages as $message) {
1076
+ DebugEcho("getemails: fetch {$message['uid']}");
1077
 
1078
+ $email = $mailbox->fetchMessage($message['uid']);
1079
 
1080
  if (!empty($email['html'])) {
1081
  DebugEcho("getemails: html");
1086
 
1087
  $emails[] = $email;
1088
  if ($deleteMessages) {
1089
+ DebugEcho("getemails: deleting {$message['uid']}");
1090
+ $mailbox->deleteMessages($message['uid']);
1091
  }
1092
  }
1093
 
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.16
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL3
@@ -28,14 +28,14 @@
28
  */
29
 
30
  /*
31
- $Id: postie.php 1826607 2018-02-22 03:46:59Z WayneAllen $
32
  */
33
 
34
  if (!defined('WPINC')) {
35
  die; // Exit if accessed directly
36
  }
37
 
38
- define('POSTIE_VERSION', '1.9.16');
39
  define('POSTIE_ROOT', dirname(__FILE__));
40
  define('POSTIE_URL', WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
41
 
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.17
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL3
28
  */
29
 
30
  /*
31
+ $Id: postie.php 1839068 2018-03-13 04:13:32Z WayneAllen $
32
  */
33
 
34
  if (!defined('WPINC')) {
35
  die; // Exit if accessed directly
36
  }
37
 
38
+ define('POSTIE_VERSION', '1.9.17');
39
  define('POSTIE_ROOT', dirname(__FILE__));
40
  define('POSTIE_URL', WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
41
 
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.9
10
- Stable tag: 1.9.16
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
@@ -107,6 +107,9 @@ All script, style and body tags are stripped from html emails.
107
  Attachments are now processed in the order they were attached.
108
 
109
  == CHANGELOG ==
 
 
 
110
  = 1.9.16 (2018-02-21) =
111
  * Fix: don't linkify URLs in style attributes
112
 
7
  Requires PHP: 5.3
8
  Requires at least: 4.0
9
  Tested up to: 4.9
10
+ Stable tag: 1.9.17
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
107
  Attachments are now processed in the order they were attached.
108
 
109
  == CHANGELOG ==
110
+ = 1.9.17 (2018-03-12) =
111
+ * Fix: Plain text with < > being processed as html causing loss of content during signature removal
112
+
113
  = 1.9.16 (2018-02-21) =
114
  * Fix: don't linkify URLs in style attributes
115