Postie - Version 1.7.32

Version Description

(2016-04-15) = * Deal with incorrectly formatted date headers

Download this release

Release Info

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

Code changes from version 1.7.30 to 1.7.32

config_form_server.php CHANGED
@@ -40,12 +40,12 @@
40
  </tr>
41
  <tr valign="top">
42
  <th scope="row"><?php _e('Mail Userid', 'postie') ?></th>
43
- <td><input name='postie-settings[mail_userid]' type="text" id='postie-settings-mail_userid' autocomplete='off' value="<?php echo esc_attr($mail_userid); ?>" size="40" /></td>
44
  </tr>
45
  <tr valign="top">
46
  <th scope="row"><?php _e('Mail Password', 'postie') ?></th>
47
  <td>
48
- <input name='postie-settings[mail_password]' type="password" id='postie-settings-mail_password' autocomplete='off' value="<?php echo esc_attr($mail_password); ?>" size="40" />
49
  </td>
50
  </tr>
51
  <tr>
40
  </tr>
41
  <tr valign="top">
42
  <th scope="row"><?php _e('Mail Userid', 'postie') ?></th>
43
+ <td><input name='postie-settings[mail_userid]' type="text" id='postie-settings-mail_userid' autocomplete='new-password' value="<?php echo esc_attr($mail_userid); ?>" size="40" /></td>
44
  </tr>
45
  <tr valign="top">
46
  <th scope="row"><?php _e('Mail Password', 'postie') ?></th>
47
  <td>
48
+ <input name='postie-settings[mail_password]' type="password" id='postie-settings-mail_password' autocomplete='new-password' value="<?php echo esc_attr($mail_password); ?>" size="40" />
49
  </td>
50
  </tr>
51
  <tr>
docs/Changes.txt CHANGED
@@ -27,6 +27,12 @@ All script, style and body tags are stripped from html emails.
27
  Attachments are now processed in the order they were attached.
28
 
29
  == CHANGELOG ==
 
 
 
 
 
 
30
  = 1.7.30 (2016-02-16) =
31
  * prevent auto-linkifying inside shortcodes
32
 
27
  Attachments are now processed in the order they were attached.
28
 
29
  == CHANGELOG ==
30
+ = 1.7.32 (2016-04-15) =
31
+ * Deal with incorrectly formatted date headers
32
+
33
+ = 1.7.31 (2016-03-05) =
34
+ * Suppress warning message when accessing POP and there are no messages.
35
+
36
  = 1.7.30 (2016-02-16) =
37
  * prevent auto-linkifying inside shortcodes
38
 
docs/Postie.txt CHANGED
@@ -1,12 +1,12 @@
1
  === Postie ===
2
- Contributors: WayneAllen, wooranker
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HPK99BJ88V4C2
4
  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.4.2
9
- Stable tag: 1.7.30
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
1
  === Postie ===
2
+ Contributors: WayneAllen
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HPK99BJ88V4C2
4
  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.5
9
+ Stable tag: 1.7.32
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
docs/TODO.txt CHANGED
@@ -5,6 +5,8 @@ Automatic updates for AddOns:
5
  http://code.tutsplus.com/series/create-a-license-controlled-theme-and-plugin-update-system--cms-760
6
 
7
  Other
 
 
8
  allow other roles access to manual check like "Roles That Can Post"
9
  Add setting to not remove category text from subject/title
10
  Test server port combination by opening a socket connection to see if any service responds. (via ajax call)
5
  http://code.tutsplus.com/series/create-a-license-controlled-theme-and-plugin-update-system--cms-760
6
 
7
  Other
8
+ review video templates for compatibility with current wordpress versions
9
+ check multiple email accounts
10
  allow other roles access to manual check like "Roles That Can Post"
11
  Add setting to not remove category text from subject/title
12
  Test server port combination by opening a socket connection to see if any service responds. (via ajax call)
postie-functions.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /*
3
- $Id: postie-functions.php 1351473 2016-02-16 05:09:02Z WayneAllen $
4
  */
5
 
6
  class PostiePostModifiers {
@@ -244,6 +244,7 @@ function CreatePost($poster, $mimeDecodedEmail, $post_id, &$is_reply, $config, $
244
 
245
  $message_date = NULL;
246
  if (array_key_exists("date", $mimeDecodedEmail->headers) && !empty($mimeDecodedEmail->headers["date"])) {
 
247
  $cte = "";
248
  $cs = "";
249
  if (property_exists($mimeDecodedEmail, 'content-transfer-encoding') && array_key_exists('content-transfer-encoding', $mimeDecodedEmail->headers)) {
@@ -252,7 +253,10 @@ function CreatePost($poster, $mimeDecodedEmail, $post_id, &$is_reply, $config, $
252
  if (property_exists($mimeDecodedEmail, 'ctype_parameters') && array_key_exists('charset', $mimeDecodedEmail->ctype_parameters)) {
253
  $cs = $mimeDecodedEmail->ctype_parameters["charset"];
254
  }
255
- $message_date = HandleMessageEncoding($cte, $cs, $mimeDecodedEmail->headers["date"], $message_encoding, $message_dequote);
 
 
 
256
  }
257
  $message_date = tag_Date($content, $message_date, 'html' == $config['prefer_text_type']);
258
 
@@ -1645,7 +1649,7 @@ function tag_Delay(&$content, $message_date = NULL, $offset = 0) {
1645
  $delay = 0;
1646
  $matches = array();
1647
  if (preg_match("/delay:(-?[0-9dhm]+)/i", $content, $matches) && trim($matches[1])) {
1648
- DebugEcho("filter_Delay: found delay: " . $matches[1]);
1649
  $days = 0;
1650
  $hours = 0;
1651
  $minutes = 0;
@@ -1662,19 +1666,26 @@ function tag_Delay(&$content, $message_date = NULL, $offset = 0) {
1662
  $minutes = $minuteMatches[1];
1663
  }
1664
  $delay = (($days * 24 + $hours) * 60 + $minutes) * 60;
1665
- DebugEcho("filter_Delay: calculated delay: $delay");
1666
  $content = preg_replace("/delay:$matches[1]/i", "", $content);
1667
  }
1668
  if (empty($message_date)) {
1669
  $dateInSeconds = time();
1670
  } else {
 
 
 
 
 
 
 
1671
  $dateInSeconds = strtotime($message_date);
1672
  }
1673
  $dateInSeconds += $delay;
1674
 
1675
  $post_date = gmdate('Y-m-d H:i:s', $dateInSeconds + ($offset * 3600));
1676
  $post_date_gmt = gmdate('Y-m-d H:i:s', $dateInSeconds);
1677
- DebugEcho("filter_Delay: post date: $post_date / $post_date_gmt (gmt)");
1678
 
1679
  return array($post_date, $post_date_gmt, $delay);
1680
  }
@@ -2359,7 +2370,7 @@ function filter_ReplaceImageCIDs(&$content, &$attachments, $config) {
2359
  $ckey = str_replace('/', '\/', $key);
2360
  $pattern = "/cid:$ckey/";
2361
  if (preg_match($pattern, $content)) {
2362
- DebugEcho("found $key");
2363
  $content = preg_replace($pattern, $info[0], $content);
2364
  $used[] = $info[1]; //Index of html to ignore
2365
  } else {
@@ -2371,15 +2382,17 @@ function filter_ReplaceImageCIDs(&$content, &$attachments, $config) {
2371
 
2372
  $html = array();
2373
  $att = array_values($attachments["html"]); //make sure there are numeric indexes
2374
- DebugEcho('$attachments["html"]');
2375
  DebugDump($attachments["html"]);
2376
- DebugEcho('$used');
2377
  DebugDump($used);
2378
  for ($i = 0; $i < count($attachments["html"]); $i++) {
2379
  DebugEcho("looking for $i in used");
2380
  if (!in_array($i, $used)) {
2381
  DebugEcho("not found, adding {$att[$i]}");
2382
  $html[] = $att[$i];
 
 
2383
  }
2384
  }
2385
 
@@ -2390,7 +2403,7 @@ function filter_ReplaceImageCIDs(&$content, &$attachments, $config) {
2390
  $html[$key] = $value;
2391
  }
2392
  }
2393
- DebugEcho('$html');
2394
  DebugDump($html);
2395
  $attachments["html"] = $html;
2396
  //DebugDump($attachments);
1
  <?php
2
  /*
3
+ $Id: postie-functions.php 1396810 2016-04-15 19:31:58Z WayneAllen $
4
  */
5
 
6
  class PostiePostModifiers {
244
 
245
  $message_date = NULL;
246
  if (array_key_exists("date", $mimeDecodedEmail->headers) && !empty($mimeDecodedEmail->headers["date"])) {
247
+ DebugEcho("date header: {$mimeDecodedEmail->headers['date']}");
248
  $cte = "";
249
  $cs = "";
250
  if (property_exists($mimeDecodedEmail, 'content-transfer-encoding') && array_key_exists('content-transfer-encoding', $mimeDecodedEmail->headers)) {
253
  if (property_exists($mimeDecodedEmail, 'ctype_parameters') && array_key_exists('charset', $mimeDecodedEmail->ctype_parameters)) {
254
  $cs = $mimeDecodedEmail->ctype_parameters["charset"];
255
  }
256
+ $message_date = HandleMessageEncoding($cte, $cs, $mimeDecodedEmail->headers["date"], $config['message_encoding'], $config['message_dequote']);
257
+ DebugEcho("decoded date: $message_date");
258
+ } else {
259
+ DebugEcho("date header missing");
260
  }
261
  $message_date = tag_Date($content, $message_date, 'html' == $config['prefer_text_type']);
262
 
1649
  $delay = 0;
1650
  $matches = array();
1651
  if (preg_match("/delay:(-?[0-9dhm]+)/i", $content, $matches) && trim($matches[1])) {
1652
+ DebugEcho("tag_Delay: found delay: " . $matches[1]);
1653
  $days = 0;
1654
  $hours = 0;
1655
  $minutes = 0;
1666
  $minutes = $minuteMatches[1];
1667
  }
1668
  $delay = (($days * 24 + $hours) * 60 + $minutes) * 60;
1669
+ DebugEcho("tag_Delay: calculated delay: $delay");
1670
  $content = preg_replace("/delay:$matches[1]/i", "", $content);
1671
  }
1672
  if (empty($message_date)) {
1673
  $dateInSeconds = time();
1674
  } else {
1675
+ //look to see if the date string has extra timezone info, e.g.: Date: Fri, 15 Apr 2016 14:39:03 -0400 (GMT-04:00)
1676
+ $i = strpos($message_date, '(');
1677
+ if ($i > 0) {
1678
+ DebugEcho("tag_Delay: found extra TZ info: $message_date");
1679
+ $message_date = substr($message_date, 0, $i - 1);
1680
+ DebugEcho("tag_Delay: new date: $message_date");
1681
+ }
1682
  $dateInSeconds = strtotime($message_date);
1683
  }
1684
  $dateInSeconds += $delay;
1685
 
1686
  $post_date = gmdate('Y-m-d H:i:s', $dateInSeconds + ($offset * 3600));
1687
  $post_date_gmt = gmdate('Y-m-d H:i:s', $dateInSeconds);
1688
+ DebugEcho("tag_Delay: post date: $post_date / $post_date_gmt (gmt)");
1689
 
1690
  return array($post_date, $post_date_gmt, $delay);
1691
  }
2370
  $ckey = str_replace('/', '\/', $key);
2371
  $pattern = "/cid:$ckey/";
2372
  if (preg_match($pattern, $content)) {
2373
+ DebugEcho("found $key replacing with $info[0]");
2374
  $content = preg_replace($pattern, $info[0], $content);
2375
  $used[] = $info[1]; //Index of html to ignore
2376
  } else {
2382
 
2383
  $html = array();
2384
  $att = array_values($attachments["html"]); //make sure there are numeric indexes
2385
+ DebugEcho('dumping $attachments["html"]');
2386
  DebugDump($attachments["html"]);
2387
+ DebugEcho('dumping $used[]');
2388
  DebugDump($used);
2389
  for ($i = 0; $i < count($attachments["html"]); $i++) {
2390
  DebugEcho("looking for $i in used");
2391
  if (!in_array($i, $used)) {
2392
  DebugEcho("not found, adding {$att[$i]}");
2393
  $html[] = $att[$i];
2394
+ } else {
2395
+ DebugEcho("found, skipping");
2396
  }
2397
  }
2398
 
2403
  $html[$key] = $value;
2404
  }
2405
  }
2406
+ DebugEcho('dumping $html[]');
2407
  DebugDump($html);
2408
  $attachments["html"] = $html;
2409
  //DebugDump($attachments);
postie.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Postie
5
  Plugin URI: http://PostiePlugin.com/
6
  Description: Create posts via email. Signifigantly upgrades the Post by Email features of Word Press.
7
- Version: 1.7.30
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL2
@@ -28,12 +28,12 @@
28
  */
29
 
30
  /*
31
- $Id: postie.php 1352195 2016-02-16 22:37:17Z WayneAllen $
32
  */
33
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib_autolink.php");
34
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
35
 
36
- define('POSTIE_VERSION', '1.7.30');
37
  define("POSTIE_ROOT", dirname(__FILE__));
38
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
39
 
4
  Plugin Name: Postie
5
  Plugin URI: http://PostiePlugin.com/
6
  Description: Create posts via email. Signifigantly upgrades the Post by Email features of Word Press.
7
+ Version: 1.7.32
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL2
28
  */
29
 
30
  /*
31
+ $Id: postie.php 1396811 2016-04-15 19:40:39Z WayneAllen $
32
  */
33
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib_autolink.php");
34
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
35
 
36
+ define('POSTIE_VERSION', '1.7.32');
37
  define("POSTIE_ROOT", dirname(__FILE__));
38
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
39
 
postieIMAP.php CHANGED
@@ -83,10 +83,10 @@ class PostieIMAP {
83
  DebugEcho($this->_protocol . ": connection string - {$this->_mailbox}");
84
  //Exchange connection, but requires PHP 5.3.2
85
  if (version_compare(phpversion(), '5.3.2', '<')) {
86
- $this->_connection = imap_open($this->_mailbox, $login, $password);
87
  } else {
88
  DebugEcho($this->_protocol . ": disabling GSSAPI");
89
- $this->_connection = imap_open($this->_mailbox, $login, $password, NULL, 1, array('DISABLE_AUTHENTICATOR' => 'GSSAPI'));
90
  }
91
 
92
  if ($this->_connection) {
83
  DebugEcho($this->_protocol . ": connection string - {$this->_mailbox}");
84
  //Exchange connection, but requires PHP 5.3.2
85
  if (version_compare(phpversion(), '5.3.2', '<')) {
86
+ $this->_connection = imap_open($this->_mailbox, $login, $password, OP_SILENT);
87
  } else {
88
  DebugEcho($this->_protocol . ": disabling GSSAPI");
89
+ $this->_connection = imap_open($this->_mailbox, $login, $password, OP_SILENT, 1, array('DISABLE_AUTHENTICATOR' => 'GSSAPI'));
90
  }
91
 
92
  if ($this->_connection) {
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.4.2
9
- Stable tag: 1.7.30
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -235,6 +235,12 @@ All script, style and body tags are stripped from html emails.
235
  Attachments are now processed in the order they were attached.
236
 
237
  == CHANGELOG ==
 
 
 
 
 
 
238
  = 1.7.30 (2016-02-16) =
239
  * prevent auto-linkifying inside shortcodes
240
 
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.5
9
+ Stable tag: 1.7.32
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
235
  Attachments are now processed in the order they were attached.
236
 
237
  == CHANGELOG ==
238
+ = 1.7.32 (2016-04-15) =
239
+ * Deal with incorrectly formatted date headers
240
+
241
+ = 1.7.31 (2016-03-05) =
242
+ * Suppress warning message when accessing POP and there are no messages.
243
+
244
  = 1.7.30 (2016-02-16) =
245
  * prevent auto-linkifying inside shortcodes
246