Postie - Version 1.9.25

Version Description

(2018-10-02) = * Add support for CIDs with surrounding <> * Add support for URLs with unusual characters

Download this release

Release Info

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

Code changes from version 1.9.24 to 1.9.25

docs/Changes.txt CHANGED
@@ -35,6 +35,10 @@ 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.24 (2018-07-12) =
39
  * log functions that use Postie filters
40
  * remove empty tags
35
  Attachments are now processed in the order they were attached.
36
 
37
  == CHANGELOG ==
38
+ = 1.9.25 (2018-10-02) =
39
+ * Add support for CIDs with surrounding <>
40
+ * Add support for URLs with unusual characters
41
+
42
  = 1.9.24 (2018-07-12) =
43
  * log functions that use Postie filters
44
  * remove empty tags
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.24
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.25
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
docs/TODO.txt CHANGED
@@ -14,6 +14,7 @@ Comment not being created when subject contains fomat or type. I.e. re: image//I
14
  Other
15
  Process single email at a time and don't delete unless successful
16
  Add default comment status (like post status) wp_set_comment_status
 
17
  provide a location for custom icons. update docs about location.
18
  "yoast" style admin sidebar - see clicky by yoast
19
  fix postie settings http://alisothegeek.com/2011/01/wordpress-settings-api-tutorial-1/
14
  Other
15
  Process single email at a time and don't delete unless successful
16
  Add default comment status (like post status) wp_set_comment_status
17
+ Send post confirmation email to: add list of individual admins (lisa@kellys.org)
18
  provide a location for custom icons. update docs about location.
19
  "yoast" style admin sidebar - see clicky by yoast
20
  fix postie settings http://alisothegeek.com/2011/01/wordpress-settings-api-tutorial-1/
lib/autolink.php CHANGED
@@ -126,7 +126,7 @@ class PostieAutolink {
126
 
127
  if ($ok) {
128
  $matches = array();
129
- if (preg_match('/^([a-z0-9\-\.\/\-_%~!?=,:;&+*#@\(\)\$]+)/i', $post, $matches)) {
130
 
131
  $url = $hit . $matches[1];
132
 
@@ -212,7 +212,7 @@ class PostieAutolink {
212
  $buffer .= $link_url_enc;
213
  } else {
214
  DebugEcho("autolink_do: linkifying $link_url");
215
- $link_html = apply_filters('postie_bare_link', "<a href=\"{$link_url_enc}\"$currentTagfill>{$display_url_enc}</a>", $link_url, false);
216
  DebugEcho("autolink_do: post postie_bare_link: $link_html");
217
  $buffer .= $link_html;
218
  }
126
 
127
  if ($ok) {
128
  $matches = array();
129
+ if (preg_match('/^([a-z0-9\-\.\/\-_%~!?=,:;&+*#@\(\)\$°’;]+)/i', $post, $matches)) {
130
 
131
  $url = $hit . $matches[1];
132
 
212
  $buffer .= $link_url_enc;
213
  } else {
214
  DebugEcho("autolink_do: linkifying $link_url");
215
+ $link_html = apply_filters('postie_bare_link', "<a href=\"{$link_url}\"$currentTagfill>{$display_url_enc}</a>", $link_url, false);
216
  DebugEcho("autolink_do: post postie_bare_link: $link_html");
217
  $buffer .= $link_html;
218
  }
lib/fMailbox.php CHANGED
@@ -694,6 +694,9 @@ class fMailbox {
694
  $info['raw_headers'] = $headers;
695
  $info['raw_message'] = $message;
696
 
 
 
 
697
  $info = self::handlePart($info, self::parseStructure($body, $parsed_headers));
698
 
699
  unset($info['raw_message']);
694
  $info['raw_headers'] = $headers;
695
  $info['raw_message'] = $message;
696
 
697
+ $info['related'] = array();
698
+ $info['attachment'] = array();
699
+ $info['inline'] = array();
700
  $info = self::handlePart($info, self::parseStructure($body, $parsed_headers));
701
 
702
  unset($info['raw_message']);
postie-filters.php CHANGED
@@ -375,6 +375,17 @@ function filter_Linkify($text) {
375
  }
376
  }
377
 
 
 
 
 
 
 
 
 
 
 
 
378
  /**
379
  * When sending in HTML email the html refers to the content-id(CID) of the image - this replaces
380
  * the cid place holder with the actual url of the image sent in
@@ -393,6 +404,13 @@ function filter_ReplaceImageCIDs($content, &$email) {
393
  $url = wp_get_attachment_url($fileid);
394
  $content = str_replace($cid, $url, $content);
395
  $attachment['exclude'] = true;
 
 
 
 
 
 
 
396
  } else {
397
  DebugEcho("filter_ReplaceImageCIDs: CID not found: $cid");
398
  }
375
  }
376
  }
377
 
378
+ function fixCID($cid) {
379
+ return $cid;
380
+ $cid = trim($cid);
381
+ if (strlen($cid) > 2) {
382
+ if ($cid[0] == '<' && $cid[strlen($cid) - 1] == '>') {
383
+ DebugEcho("fixCID: removing extra <> from $cid");
384
+ $cid = substr($cid, 1, strlen($cid) - 2);
385
+ }
386
+ }
387
+ }
388
+
389
  /**
390
  * When sending in HTML email the html refers to the content-id(CID) of the image - this replaces
391
  * the cid place holder with the actual url of the image sent in
404
  $url = wp_get_attachment_url($fileid);
405
  $content = str_replace($cid, $url, $content);
406
  $attachment['exclude'] = true;
407
+ } elseif (false !== stripos($content, fixCID($cid))) {
408
+ //some email clients add surrounding <> in the image header CID, but not in the email body
409
+ DebugEcho("filter_ReplaceImageCIDs: CID (fixed): $cid");
410
+ $fileid = $attachment['wp_id'];
411
+ $url = wp_get_attachment_url($fileid);
412
+ $content = str_replace(fixCID($cid), $url, $content);
413
+ $attachment['exclude'] = true;
414
  } else {
415
  DebugEcho("filter_ReplaceImageCIDs: CID not found: $cid");
416
  }
postie.class.php CHANGED
@@ -1185,7 +1185,6 @@ class Postie {
1185
  $mailtext = apply_filters('postie_email_notify_body', $mailtext, $email, $postid);
1186
  DebugEcho("email_notify: post postie_email_notify_body: $mailtext");
1187
 
1188
-
1189
  wp_mail($recipients, $subject, $mailtext, $sendheaders);
1190
  }
1191
 
1185
  $mailtext = apply_filters('postie_email_notify_body', $mailtext, $email, $postid);
1186
  DebugEcho("email_notify: post postie_email_notify_body: $mailtext");
1187
 
 
1188
  wp_mail($recipients, $subject, $mailtext, $sendheaders);
1189
  }
1190
 
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.24
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL3
@@ -28,14 +28,14 @@
28
  */
29
 
30
  /*
31
- $Id: postie.php 1908297 2018-07-12 15:10:42Z WayneAllen $
32
  */
33
 
34
  if (!defined('WPINC')) {
35
  die; // Exit if accessed directly
36
  }
37
 
38
- define('POSTIE_VERSION', '1.9.24');
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.25
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL3
28
  */
29
 
30
  /*
31
+ $Id: postie.php 1950583 2018-10-03 03:30:54Z WayneAllen $
32
  */
33
 
34
  if (!defined('WPINC')) {
35
  die; // Exit if accessed directly
36
  }
37
 
38
+ define('POSTIE_VERSION', '1.9.25');
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.24
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
@@ -107,6 +107,10 @@ 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.24 (2018-07-12) =
111
  * log functions that use Postie filters
112
  * remove empty tags
7
  Requires PHP: 5.3
8
  Requires at least: 4.0
9
  Tested up to: 4.9
10
+ Stable tag: 1.9.25
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.25 (2018-10-02) =
111
+ * Add support for CIDs with surrounding <>
112
+ * Add support for URLs with unusual characters
113
+
114
  = 1.9.24 (2018-07-12) =
115
  * log functions that use Postie filters
116
  * remove empty tags