Postie - Version 1.8.44

Version Description

(2017-06-14) = * Ensure only users from current site are validated. * Process newlines earlier in process * WordPress 4.8 compatibility testing

Download this release

Release Info

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

Code changes from version 1.8.43 to 1.8.44

Files changed (5) hide show
  1. docs/Changes.txt +5 -0
  2. docs/Postie.txt +2 -2
  3. postie-functions.php +20 -13
  4. postie.php +3 -3
  5. readme.txt +7 -2
docs/Changes.txt CHANGED
@@ -35,6 +35,11 @@ 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.8.43 (2017-05-10) =
39
  * Fix "postie-attachments" div to wrap the right content
40
  * Fix time zone adjustment
35
  Attachments are now processed in the order they were attached.
36
 
37
  == CHANGELOG ==
38
+ = 1.8.44 (2017-06-14) =
39
+ * Ensure only users from current site are validated.
40
+ * Process newlines earlier in process
41
+ * WordPress 4.8 compatibility testing
42
+
43
  = 1.8.43 (2017-05-10) =
44
  * Fix "postie-attachments" div to wrap the right content
45
  * Fix time zone adjustment
docs/Postie.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.4
9
- Stable tag: 1.8.43
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
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.8
9
+ Stable tag: 1.8.44
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
postie-functions.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /*
3
- $Id: postie-functions.php 1654686 2017-05-10 23:24:36Z WayneAllen $
4
  */
5
 
6
  class PostiePostModifiers {
@@ -391,6 +391,11 @@ function postie_create_post($poster, $mimeDecodedEmail, $post_id, &$is_reply, $c
391
 
392
  $subject = postie_get_subject($mimeDecodedEmail, $content, $config);
393
 
 
 
 
 
 
394
  $content = filter_RemoveSignature($content, $config);
395
  if ($fulldebug) {
396
  DebugEcho("post sig: $content");
@@ -514,11 +519,6 @@ function postie_create_post($poster, $mimeDecodedEmail, $post_id, &$is_reply, $c
514
  $post_status = 'future';
515
  }
516
 
517
- $content = filter_Newlines($content, $config);
518
- if ($fulldebug) {
519
- DebugEcho("post newline: $content");
520
- }
521
-
522
  $content = filter_Start($content, $config);
523
  if ($fulldebug) {
524
  DebugEcho("post start: $content");
@@ -624,7 +624,7 @@ function PostEmail($poster, $mimeDecodedEmail, $config) {
624
  $recipients = array($details['email_author']);
625
  }
626
  if ($config['confirmation_email'] == 'admin' || $config['confirmation_email'] == 'both') {
627
- foreach (get_users(array('role' => 'administrator')) as $user) {
628
  $recipients[] = $user->user_email;
629
  }
630
  }
@@ -869,7 +869,7 @@ function postie_notify_error($subject, $message) {
869
  return;
870
  }
871
  if ($config['postie_log_error_notify'] == '(All Admins)') {
872
- foreach (get_users(array('role' => 'administrator')) as $user) {
873
  $recipients[] = $user->user_email;
874
  }
875
  if (count($recipients) == 0) {
@@ -1286,15 +1286,19 @@ function postie_ValidatePoster(&$mimeDecodedEmail, $config) {
1286
  }
1287
 
1288
  //See if the email address is one of the special authorized ones
 
1289
  if (!empty($from)) {
1290
  DebugEcho("Confirming Access For $from ");
1291
  $user = get_user_by('email', $from);
1292
  if ($user !== false) {
1293
- $user_ID = $user->ID;
 
 
 
 
1294
  }
1295
- } else {
1296
- $user_ID = "";
1297
  }
 
1298
  if (!empty($user_ID)) {
1299
  $user = new WP_User($user_ID);
1300
  if ($user->has_cap("post_via_postie")) {
@@ -1309,6 +1313,7 @@ function postie_ValidatePoster(&$mimeDecodedEmail, $config) {
1309
  $user_ID = "";
1310
  }
1311
  }
 
1312
  if (empty($user_ID) && ($config['turn_authorization_off'] || postie_isEmailAddressAuthorized($from, $config['authorized_addresses']) || postie_isEmailAddressAuthorized($resentFrom, $config['authorized_addresses']))) {
1313
  DebugEcho("ValidatePoster: looking up default user " . $config['admin_username']);
1314
  $user = get_user_by('login', $config['admin_username']);
@@ -1725,7 +1730,9 @@ function postie_email_notify($email, $recipients, $postid) {
1725
 
1726
  $sendheaders = array("From: $eblogname <$myemailadd>");
1727
 
1728
- $mailtext = "Your post '$subject' has been successfully published to $blogname <$posturl>.\n";
 
 
1729
 
1730
  $recipients = apply_filters('postie_email_notify_recipients', $recipients, $email, $postid);
1731
  if (count($recipients) == 0) {
@@ -1735,7 +1742,7 @@ function postie_email_notify($email, $recipients, $postid) {
1735
  DebugEcho("postie_email_notify: post postie_email_notify_recipients");
1736
  DebugDump($recipients);
1737
  }
1738
- $subject = "Successfully posted to $blogname";
1739
  $subject = apply_filters('postie_email_notify_subject', $subject, $email, $postid);
1740
  DebugEcho("postie_email_notify: post postie_email_notify_subject: $subject");
1741
 
1
  <?php
2
  /*
3
+ $Id: postie-functions.php 1678569 2017-06-14 16:42:23Z WayneAllen $
4
  */
5
 
6
  class PostiePostModifiers {
391
 
392
  $subject = postie_get_subject($mimeDecodedEmail, $content, $config);
393
 
394
+ $content = filter_Newlines($content, $config);
395
+ if ($fulldebug) {
396
+ DebugEcho("post newline: $content");
397
+ }
398
+
399
  $content = filter_RemoveSignature($content, $config);
400
  if ($fulldebug) {
401
  DebugEcho("post sig: $content");
519
  $post_status = 'future';
520
  }
521
 
 
 
 
 
 
522
  $content = filter_Start($content, $config);
523
  if ($fulldebug) {
524
  DebugEcho("post start: $content");
624
  $recipients = array($details['email_author']);
625
  }
626
  if ($config['confirmation_email'] == 'admin' || $config['confirmation_email'] == 'both') {
627
+ foreach (get_users(array('role' => 'administrator', 'blog_id' => get_current_blog_id())) as $user) {
628
  $recipients[] = $user->user_email;
629
  }
630
  }
869
  return;
870
  }
871
  if ($config['postie_log_error_notify'] == '(All Admins)') {
872
+ foreach (get_users(array('role' => 'administrator', 'blog_id' => get_current_blog_id())) as $user) {
873
  $recipients[] = $user->user_email;
874
  }
875
  if (count($recipients) == 0) {
1286
  }
1287
 
1288
  //See if the email address is one of the special authorized ones
1289
+ $user_ID = '';
1290
  if (!empty($from)) {
1291
  DebugEcho("Confirming Access For $from ");
1292
  $user = get_user_by('email', $from);
1293
  if ($user !== false) {
1294
+ if (is_user_member_of_blog($user->ID)) {
1295
+ $user_ID = $user->ID;
1296
+ } else {
1297
+ DebugEcho("$from is not user of blog " . get_current_blog_id());
1298
+ }
1299
  }
 
 
1300
  }
1301
+
1302
  if (!empty($user_ID)) {
1303
  $user = new WP_User($user_ID);
1304
  if ($user->has_cap("post_via_postie")) {
1313
  $user_ID = "";
1314
  }
1315
  }
1316
+
1317
  if (empty($user_ID) && ($config['turn_authorization_off'] || postie_isEmailAddressAuthorized($from, $config['authorized_addresses']) || postie_isEmailAddressAuthorized($resentFrom, $config['authorized_addresses']))) {
1318
  DebugEcho("ValidatePoster: looking up default user " . $config['admin_username']);
1319
  $user = get_user_by('login', $config['admin_username']);
1730
 
1731
  $sendheaders = array("From: $eblogname <$myemailadd>");
1732
 
1733
+ $post_status = get_post_status($postid);
1734
+
1735
+ $mailtext = "Your email '$subject' has been successfully imported into $blogname $posturl with the current status of '$post_status'.\n";
1736
 
1737
  $recipients = apply_filters('postie_email_notify_recipients', $recipients, $email, $postid);
1738
  if (count($recipients) == 0) {
1742
  DebugEcho("postie_email_notify: post postie_email_notify_recipients");
1743
  DebugDump($recipients);
1744
  }
1745
+ $subject = "Email imported to $blogname ($post_status)";
1746
  $subject = apply_filters('postie_email_notify_subject', $subject, $email, $postid);
1747
  DebugEcho("postie_email_notify: post postie_email_notify_subject: $subject");
1748
 
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.43
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL2
@@ -28,7 +28,7 @@
28
  */
29
 
30
  /*
31
- $Id: postie.php 1654689 2017-05-10 23:26:11Z WayneAllen $
32
  */
33
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib/fException.php");
34
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib/fUnexpectedException.php");
@@ -62,7 +62,7 @@ if (!function_exists('file_get_html')) {
62
  require_once (plugin_dir_path(__FILE__) . 'lib/simple_html_dom.php');
63
  }
64
 
65
- define('POSTIE_VERSION', '1.8.43');
66
  define("POSTIE_ROOT", dirname(__FILE__));
67
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
68
 
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.44
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL2
28
  */
29
 
30
  /*
31
+ $Id: postie.php 1678570 2017-06-14 16:44:10Z WayneAllen $
32
  */
33
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib/fException.php");
34
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib/fUnexpectedException.php");
62
  require_once (plugin_dir_path(__FILE__) . 'lib/simple_html_dom.php');
63
  }
64
 
65
+ define('POSTIE_VERSION', '1.8.44');
66
  define("POSTIE_ROOT", dirname(__FILE__));
67
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
68
 
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.4
9
- Stable tag: 1.8.43
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -242,6 +242,11 @@ All script, style and body tags are stripped from html emails.
242
  Attachments are now processed in the order they were attached.
243
 
244
  == CHANGELOG ==
 
 
 
 
 
245
  = 1.8.43 (2017-05-10) =
246
  * Fix "postie-attachments" div to wrap the right content
247
  * Fix time zone adjustment
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.8
9
+ Stable tag: 1.8.44
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
242
  Attachments are now processed in the order they were attached.
243
 
244
  == CHANGELOG ==
245
+ = 1.8.44 (2017-06-14) =
246
+ * Ensure only users from current site are validated.
247
+ * Process newlines earlier in process
248
+ * WordPress 4.8 compatibility testing
249
+
250
  = 1.8.43 (2017-05-10) =
251
  * Fix "postie-attachments" div to wrap the right content
252
  * Fix time zone adjustment