Postie - Version 1.8.23

Version Description

(2017-01-12) = * Fix bug where long subject lines are missing a space. * Fix bug where {CAPTION} placeholder not being removed if no caption.

Download this release

Release Info

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

Code changes from version 1.8.22 to 1.8.23

docs/Changes.txt CHANGED
@@ -32,6 +32,10 @@ All script, style and body tags are stripped from html emails.
32
  Attachments are now processed in the order they were attached.
33
 
34
  == CHANGELOG ==
 
 
 
 
35
  = 1.8.22 (2016-12-07) =
36
  * Fix bug where Image Place Holder Tag setting was not respected
37
 
32
  Attachments are now processed in the order they were attached.
33
 
34
  == CHANGELOG ==
35
+ = 1.8.23 (future) =
36
+ * Fix bug where long subject lines are missing a space.
37
+ * Fix bug where {CAPTION} placeholder not being removed if no caption.
38
+
39
  = 1.8.22 (2016-12-07) =
40
  * Fix bug where Image Place Holder Tag setting was not respected
41
 
docs/Postie.txt CHANGED
@@ -6,7 +6,7 @@ Plugin URI: http://PostiePlugin.com/
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.3.0
8
  Tested up to: 4.7
9
- Stable tag: 1.8.22
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.3.0
8
  Tested up to: 4.7
9
+ Stable tag: 1.8.23
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
lib/fMailbox.php CHANGED
@@ -528,7 +528,8 @@ class fMailbox {
528
 
529
  $headers = array();
530
  foreach ($header_lines as $header_line) {
531
- $header_line = preg_replace("#\r\n\s+#", '', $header_line);
 
532
 
533
  if (false !== strpos($header_line, ':')) {
534
  list ($header, $value) = preg_split('#:\s*#', $header_line, 2);
528
 
529
  $headers = array();
530
  foreach ($header_lines as $header_line) {
531
+ DebugEcho("headerline: $header_line");
532
+ $header_line = preg_replace("#\r\n\s+#", ' ', $header_line);
533
 
534
  if (false !== strpos($header_line, ':')) {
535
  list ($header, $value) = preg_split('#:\s*#', $header_line, 2);
lib/pPop3MailServer.php CHANGED
@@ -13,7 +13,7 @@ class pPop3MailServer extends pMailServer {
13
  $total_messages = 0;
14
 
15
  $response = $this->connection->write('STAT', '#^\+OK\s+(\d+)\s+#');
16
- DebugEcho("pop count: $response");
17
  preg_match('#^\+OK\s+(\d+)\s+#', $response[count($response) - 1], $match);
18
  $total_messages = $match[1];
19
 
13
  $total_messages = 0;
14
 
15
  $response = $this->connection->write('STAT', '#^\+OK\s+(\d+)\s+#');
16
+ DebugEcho("pop count: " . $response[count($response) - 1]);
17
  preg_match('#^\+OK\s+(\d+)\s+#', $response[count($response) - 1], $match);
18
  $total_messages = $match[1];
19
 
postie-functions.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /*
3
- $Id: postie-functions.php 1548027 2016-12-07 19:33:59Z WayneAllen $
4
  */
5
 
6
  class PostiePostModifiers {
@@ -228,6 +228,7 @@ function filter_AttachmentTemplates($content, $mimeDecodedEmail, $post_id, $conf
228
  } else {
229
  $template = apply_filters('postie_place_media_before', $template, $attachment['wp_id']);
230
  }
 
231
  DebugEcho("filter_AttachmentTemplates: post filter '$template'");
232
  $html .= $template;
233
  }
@@ -251,6 +252,7 @@ function filter_AttachmentTemplates($content, $mimeDecodedEmail, $post_id, $conf
251
  } else {
252
  $template = apply_filters('postie_place_media_before', $template, $attachment['wp_id']);
253
  }
 
254
  DebugEcho("filter_AttachmentTemplates: post filter (alt) '$template'");
255
  $html .= $template;
256
  }
@@ -549,7 +551,7 @@ function PostEmail($poster, $mimeDecodedEmail, $config) {
549
  $details = apply_filters('postie_post', $details);
550
  $details = apply_filters('postie_post_before', $details, $mimeDecodedEmail['headers']);
551
 
552
- DebugEcho(("Post postie_post filter"));
553
  DebugDump($details);
554
 
555
  if (empty($details)) {
@@ -2283,6 +2285,7 @@ function tag_Categories(&$subject, $defaultCategoryId, $config, $post_id) {
2283
  if (count($matches)) {
2284
  $i = 0;
2285
  foreach ($matches[1] as $match) {
 
2286
  $category = lookup_category($match, $category_match);
2287
  if (!empty($category)) {
2288
  $found = true;
@@ -2320,40 +2323,48 @@ function lookup_taxonomy($termid) {
2320
  function lookup_category($trial_category, $category_match) {
2321
  global $wpdb;
2322
  $trial_category = trim($trial_category);
2323
- $found_category = NULL;
2324
  DebugEcho("lookup_category: $trial_category");
2325
 
2326
  $term = get_term_by('name', esc_attr($trial_category), 'category');
2327
  if (!empty($term)) {
2328
- DebugEcho("category: found by name $trial_category");
2329
  //DebugDump($term);
2330
  //then category is a named and found
2331
  return $term->term_id;
 
 
2332
  }
2333
 
2334
  $term = get_term_by('slug', esc_attr($trial_category), 'category');
2335
  if (!empty($term)) {
2336
- DebugEcho("category: found by slug $trial_category");
2337
  return $term->term_id;
 
 
2338
  }
2339
 
2340
  if (is_numeric($trial_category)) {
2341
- DebugEcho("category: looking for id '$trial_category'");
2342
  $cat_id = intval($trial_category);
2343
  $term = get_term_by('id', $cat_id, 'category');
2344
  if (!empty($term) && $term->term_id == $trial_category) {
2345
- DebugEcho("category: found by id '$cat_id'");
2346
  DebugDump($term);
2347
- //then cateogry was an ID and found
2348
  return $term->term_id;
 
 
2349
  }
2350
  }
2351
 
 
2352
  if ($category_match) {
2353
  DebugEcho("category wildcard lookup: $trial_category");
2354
  $sql_sub_name = 'SELECT term_id FROM ' . $wpdb->terms . ' WHERE name LIKE \'' . addslashes(esc_attr($trial_category)) . '%\' limit 1';
2355
  $found_category = $wpdb->get_var($sql_sub_name);
2356
- DebugEcho("category wildcard found: $found_category");
 
 
2357
  }
2358
 
2359
  return intval($found_category); //force to integer
@@ -3159,6 +3170,10 @@ function postie_get_mail() {
3159
  include_once ($wp_content_path . DIRECTORY_SEPARATOR . "filterPostie.php");
3160
  }
3161
 
 
 
 
 
3162
  do_action('postie_session_start');
3163
 
3164
  if (has_filter('postie_post')) {
@@ -3177,10 +3192,6 @@ function postie_get_mail() {
3177
 
3178
  DebugEcho(sprintf(__("There are %d messages to process", 'postie'), count($emails)));
3179
 
3180
- if (function_exists('memory_get_usage')) {
3181
- DebugEcho(__("memory at start of email processing:", 'postie') . memory_get_usage());
3182
- }
3183
-
3184
  //don't output the password
3185
  $tmp_config = $config;
3186
  unset($tmp_config['mail_password']);
1
  <?php
2
  /*
3
+ $Id: postie-functions.php 1573517 2017-01-12 18:46:44Z WayneAllen $
4
  */
5
 
6
  class PostiePostModifiers {
228
  } else {
229
  $template = apply_filters('postie_place_media_before', $template, $attachment['wp_id']);
230
  }
231
+ $template = mb_str_replace('{CAPTION}', '', $template);
232
  DebugEcho("filter_AttachmentTemplates: post filter '$template'");
233
  $html .= $template;
234
  }
252
  } else {
253
  $template = apply_filters('postie_place_media_before', $template, $attachment['wp_id']);
254
  }
255
+ $template = mb_str_replace('{CAPTION}', '', $template);
256
  DebugEcho("filter_AttachmentTemplates: post filter (alt) '$template'");
257
  $html .= $template;
258
  }
551
  $details = apply_filters('postie_post', $details);
552
  $details = apply_filters('postie_post_before', $details, $mimeDecodedEmail['headers']);
553
 
554
+ DebugEcho("Post postie_post_before filter");
555
  DebugDump($details);
556
 
557
  if (empty($details)) {
2285
  if (count($matches)) {
2286
  $i = 0;
2287
  foreach ($matches[1] as $match) {
2288
+ DebugEcho("tag_Categories: checking: $match");
2289
  $category = lookup_category($match, $category_match);
2290
  if (!empty($category)) {
2291
  $found = true;
2323
  function lookup_category($trial_category, $category_match) {
2324
  global $wpdb;
2325
  $trial_category = trim($trial_category);
 
2326
  DebugEcho("lookup_category: $trial_category");
2327
 
2328
  $term = get_term_by('name', esc_attr($trial_category), 'category');
2329
  if (!empty($term)) {
2330
+ DebugEcho("lookup_category: found by name $trial_category");
2331
  //DebugDump($term);
2332
  //then category is a named and found
2333
  return $term->term_id;
2334
+ } else {
2335
+ DebugEcho("lookup_category: not found by name $trial_category");
2336
  }
2337
 
2338
  $term = get_term_by('slug', esc_attr($trial_category), 'category');
2339
  if (!empty($term)) {
2340
+ DebugEcho("lookup_category: found by slug $trial_category");
2341
  return $term->term_id;
2342
+ } else {
2343
+ DebugEcho("lookup_category: not found by slug $trial_category");
2344
  }
2345
 
2346
  if (is_numeric($trial_category)) {
2347
+ DebugEcho("lookup_category: looking for id '$trial_category'");
2348
  $cat_id = intval($trial_category);
2349
  $term = get_term_by('id', $cat_id, 'category');
2350
  if (!empty($term) && $term->term_id == $trial_category) {
2351
+ DebugEcho("lookup_category: found by id '$cat_id'");
2352
  DebugDump($term);
2353
+ //then category was an ID and found
2354
  return $term->term_id;
2355
+ } else {
2356
+ DebugEcho("lookup_category: not found by id '$cat_id'");
2357
  }
2358
  }
2359
 
2360
+ $found_category = NULL;
2361
  if ($category_match) {
2362
  DebugEcho("category wildcard lookup: $trial_category");
2363
  $sql_sub_name = 'SELECT term_id FROM ' . $wpdb->terms . ' WHERE name LIKE \'' . addslashes(esc_attr($trial_category)) . '%\' limit 1';
2364
  $found_category = $wpdb->get_var($sql_sub_name);
2365
+ DebugEcho("lookup_category: wildcard found: $found_category");
2366
+ } else {
2367
+ DebugEcho("lookup_category: wildcard not found: $found_category");
2368
  }
2369
 
2370
  return intval($found_category); //force to integer
3170
  include_once ($wp_content_path . DIRECTORY_SEPARATOR . "filterPostie.php");
3171
  }
3172
 
3173
+ if (function_exists('memory_get_usage')) {
3174
+ DebugEcho(__("memory at start of email processing: ", 'postie') . memory_get_usage());
3175
+ }
3176
+
3177
  do_action('postie_session_start');
3178
 
3179
  if (has_filter('postie_post')) {
3192
 
3193
  DebugEcho(sprintf(__("There are %d messages to process", 'postie'), count($emails)));
3194
 
 
 
 
 
3195
  //don't output the password
3196
  $tmp_config = $config;
3197
  unset($tmp_config['mail_password']);
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.8.22
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL2
@@ -28,7 +28,7 @@
28
  */
29
 
30
  /*
31
- $Id: postie.php 1548029 2016-12-07 19:35:22Z WayneAllen $
32
  */
33
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib/fException.php");
34
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib/fUnexpectedException.php");
@@ -49,7 +49,7 @@ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib/pPop3MailServer.php"
49
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib_autolink.php");
50
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
51
 
52
- define('POSTIE_VERSION', '1.8.22');
53
  define("POSTIE_ROOT", dirname(__FILE__));
54
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
55
 
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.8.23
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL2
28
  */
29
 
30
  /*
31
+ $Id: postie.php 1573518 2017-01-12 18:47:59Z WayneAllen $
32
  */
33
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib/fException.php");
34
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib/fUnexpectedException.php");
49
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib_autolink.php");
50
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
51
 
52
+ define('POSTIE_VERSION', '1.8.23');
53
  define("POSTIE_ROOT", dirname(__FILE__));
54
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
55
 
readme.txt CHANGED
@@ -5,8 +5,8 @@ Author URI: http://allens-home.com/
5
  Plugin URI: http://PostiePlugin.com/
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.3.0
8
- Tested up to: 4.7
9
- Stable tag: 1.8.22
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -239,6 +239,10 @@ All script, style and body tags are stripped from html emails.
239
  Attachments are now processed in the order they were attached.
240
 
241
  == CHANGELOG ==
 
 
 
 
242
  = 1.8.22 (2016-12-07) =
243
  * Fix bug where Image Place Holder Tag setting was not respected
244
 
5
  Plugin URI: http://PostiePlugin.com/
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.3.0
8
+ Tested up to: 4.7.1
9
+ Stable tag: 1.8.23
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
239
  Attachments are now processed in the order they were attached.
240
 
241
  == CHANGELOG ==
242
+ = 1.8.23 (2017-01-12) =
243
+ * Fix bug where long subject lines are missing a space.
244
+ * Fix bug where {CAPTION} placeholder not being removed if no caption.
245
+
246
  = 1.8.22 (2016-12-07) =
247
  * Fix bug where Image Place Holder Tag setting was not respected
248