Postie - Version 1.9.19

Version Description

(2018-03-21) = * Fix: Recognize paragraph line ending in text mode for both styles

Download this release

Release Info

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

Code changes from version 1.9.18 to 1.9.19

Files changed (7) hide show
  1. docs/Changes.txt +3 -0
  2. docs/Postie.txt +1 -1
  3. postie-filters.php +1 -1
  4. postie-tags.php +20 -10
  5. postie.class.php +1 -1
  6. postie.php +3 -3
  7. readme.txt +4 -1
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.18 (2018-03-13) =
39
  * Fix: new signature removal logic removed line endings in some cases
40
 
35
  Attachments are now processed in the order they were attached.
36
 
37
  == CHANGELOG ==
38
+ = 1.9.19 (2018-03-21) =
39
+ * Fix: Recognize paragraph line ending in text mode for both styles
40
+
41
  = 1.9.18 (2018-03-13) =
42
  * Fix: new signature removal logic removed line endings in some cases
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.18
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.19
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
postie-filters.php CHANGED
@@ -301,7 +301,7 @@ function filter_Newlines($content, $config) {
301
  $replace = array(
302
  'PARABREAK',
303
  'LINEBREAK',
304
- 'LINEBREAK',
305
  'LINEBREAK',
306
  'LINEBREAK'
307
  );
301
  $replace = array(
302
  'PARABREAK',
303
  'LINEBREAK',
304
+ 'PARABREAK',
305
  'LINEBREAK',
306
  'LINEBREAK'
307
  );
postie-tags.php CHANGED
@@ -1,15 +1,23 @@
1
  <?php
2
 
3
- function postie_is_html($str) {
4
- return (1 == preg_match('/<[a-z][\s\S]*>/i', $str));
 
 
 
 
 
 
 
 
5
  }
6
 
7
- function postie_content_lines($content) {
8
  global $g_postie;
9
 
10
  $lines = array();
11
- if (postie_is_html($content)) {
12
- //DebugEcho("postie_content_lines: html");
13
  $html = $g_postie->load_html($content);
14
  if ($html !== false) {
15
  $es = $html->find('text');
@@ -19,7 +27,7 @@ function postie_content_lines($content) {
19
  }
20
  }
21
  } else {
22
- //DebugEcho("postie_content_lines: not html");
23
  $lines = explode("\n", $content);
24
  }
25
  return $lines;
@@ -430,13 +438,15 @@ function tag_Date(&$content, $message_date) {
430
  return $message_date;
431
  }
432
 
433
- function tag_Tags(&$content, $defaultTags) {
 
434
  $post_tags = array();
435
- foreach (postie_content_lines($content) as $lines) {
 
436
  $matches = array();
437
- if (preg_match('/^\s*tags:\s*(.*)/imu', $lines, $matches)) {
438
  if (!empty($matches[1])) {
439
- DebugEcho("Found tags: $matches[1]");
440
  $content = str_replace($matches[0], "", $content);
441
  $post_tags = array_merge($post_tags, preg_split("/,\s*/", trim($matches[1])));
442
  }
1
  <?php
2
 
3
+ function postie_is_html($str, $config = null) {
4
+ if (empty($config)) {
5
+ $h = (1 === preg_match('/<[a-z][\s\S]*>/i', $str));
6
+ DebugEcho('postie_is_html: content: ' . $h ? 'true' : 'false');
7
+ return $h;
8
+ } else {
9
+ $h = $config['prefer_text_type'] === 'html';
10
+ DebugEcho('postie_is_html: config: ' . $h ? 'true' : 'false');
11
+ return $h;
12
+ }
13
  }
14
 
15
+ function postie_content_lines($content, $config = null) {
16
  global $g_postie;
17
 
18
  $lines = array();
19
+ if (postie_is_html($content, $config)) {
20
+ DebugEcho("postie_content_lines: html");
21
  $html = $g_postie->load_html($content);
22
  if ($html !== false) {
23
  $es = $html->find('text');
27
  }
28
  }
29
  } else {
30
+ DebugEcho("postie_content_lines: plain");
31
  $lines = explode("\n", $content);
32
  }
33
  return $lines;
438
  return $message_date;
439
  }
440
 
441
+ function tag_Tags(&$content, $config) {
442
+ $defaultTags = $config['default_post_tags'];
443
  $post_tags = array();
444
+ foreach (postie_content_lines($content, $config) as $line) {
445
+ //DebugEcho("tag_Tags: line: $line");
446
  $matches = array();
447
+ if (preg_match('/^\s*tags:\s*(.*)/imu', $line, $matches)) {
448
  if (!empty($matches[1])) {
449
+ DebugEcho("tag_Tags: Found tags: $matches[1]");
450
  $content = str_replace($matches[0], "", $content);
451
  $post_tags = array_merge($post_tags, preg_split("/,\s*/", trim($matches[1])));
452
  }
postie.class.php CHANGED
@@ -697,7 +697,7 @@ class Postie {
697
  DebugEcho("post tag_Categories: $content");
698
  }
699
 
700
- $post_tags = tag_Tags($content, $config['default_post_tags']);
701
  if ($fulldebug) {
702
  DebugEcho("post tag_Tags: $content");
703
  }
697
  DebugEcho("post tag_Categories: $content");
698
  }
699
 
700
+ $post_tags = tag_Tags($content, $config);
701
  if ($fulldebug) {
702
  DebugEcho("post tag_Tags: $content");
703
  }
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.18
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL3
@@ -28,14 +28,14 @@
28
  */
29
 
30
  /*
31
- $Id: postie.php 1839412 2018-03-13 14:50:53Z WayneAllen $
32
  */
33
 
34
  if (!defined('WPINC')) {
35
  die; // Exit if accessed directly
36
  }
37
 
38
- define('POSTIE_VERSION', '1.9.18');
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.19
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL3
28
  */
29
 
30
  /*
31
+ $Id: postie.php 1844621 2018-03-22 02:48:40Z WayneAllen $
32
  */
33
 
34
  if (!defined('WPINC')) {
35
  die; // Exit if accessed directly
36
  }
37
 
38
+ define('POSTIE_VERSION', '1.9.19');
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.18
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.18 (2018-03-13) =
111
  * Fix: new signature removal logic removed line endings in some cases
112
 
7
  Requires PHP: 5.3
8
  Requires at least: 4.0
9
  Tested up to: 4.9
10
+ Stable tag: 1.9.19
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.19 (2018-03-21) =
111
+ * Fix: Recognize paragraph line ending in text mode for both styles
112
+
113
  = 1.9.18 (2018-03-13) =
114
  * Fix: new signature removal logic removed line endings in some cases
115