Postie - Version 1.6.8

Version Description

(2014.11.14) = * Fixed bug where the #img tag was being used as the subject if it is the very first line in the email. * Fixed bug where the allow subject in body setting was being ignored.

Download this release

Release Info

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

Code changes from version 1.6.7 to 1.6.8

Files changed (5) hide show
  1. docs/Changes.txt +4 -0
  2. docs/Postie.txt +1 -1
  3. postie-functions.php +20 -18
  4. postie.php +3 -3
  5. readme.txt +5 -1
docs/Changes.txt CHANGED
@@ -27,6 +27,10 @@ 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.6.7 (2014.11.05) =
31
  * Fixed bug where base64 text with utf-8 charset was trying to convert encoding to utf-8
32
 
27
  Attachments are now processed in the order they were attached.
28
 
29
  == CHANGELOG ==
30
+ = 1.6.8 (2014.11.14) =
31
+ * Fixed bug where the #img tag was being used as the subject if it is the very first line in the email.
32
+ * Fixed bug where the allow subject in body setting was being ignored.
33
+
34
  = 1.6.7 (2014.11.05) =
35
  * Fixed bug where base64 text with utf-8 charset was trying to convert encoding to utf-8
36
 
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.0
8
  Tested up to: 4.0
9
- Stable tag: 1.6.6
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.0
8
  Tested up to: 4.0
9
+ Stable tag: 1.6.8
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 1020370 2014-11-05 17:14:32Z WayneAllen $
4
  */
5
 
6
  //to turn on debug output add the following line to wp-config.php
@@ -1710,11 +1710,6 @@ function tag_Status(&$content, $currentstatus) {
1710
  return $poststatus;
1711
  }
1712
 
1713
- /**
1714
- * Needed to be able to modify the content to remove the usage of the delay tag
1715
- *
1716
- * todo split delay tag from date logic
1717
- */
1718
  function filter_Delay(&$content, $message_date = NULL, $offset = 0) {
1719
  $delay = 0;
1720
  $matches = array();
@@ -1762,15 +1757,20 @@ function tag_Subject($content, $defaultTitle) {
1762
  DebugEcho("tag_Subject: No subject found, using default [1]");
1763
  return(array($defaultTitle, $content));
1764
  }
1765
- $subjectEndIndex = strpos($content, "#", 1);
1766
- if (!$subjectEndIndex > 0) {
1767
- DebugEcho("tag_Subject: No subject found, using default [2]");
 
 
 
 
 
 
 
 
 
1768
  return(array($defaultTitle, $content));
1769
  }
1770
- $subject = substr($content, 1, $subjectEndIndex - 1);
1771
- $content = substr($content, $subjectEndIndex + 1, strlen($content));
1772
- DebugEcho("tag_Subject: Subject found in body: $subject");
1773
- return array($subject, $content);
1774
  }
1775
 
1776
  /**
@@ -2541,14 +2541,16 @@ function GetSubject(&$mimeDecodedEmail, &$content, $config) {
2541
  $subject = $mimeDecodedEmail->headers['subject'];
2542
  DebugEcho(("Predecoded subject: $subject"));
2543
 
2544
- if (!$allow_html_in_subject) {
2545
- DebugEcho("subject before htmlentities: $subject");
2546
- $subject = htmlentities($subject, ENT_COMPAT, $message_encoding);
2547
- DebugEcho("subject after htmlentities: $subject");
2548
- } else {
2549
  list($subject, $content) = tag_Subject($content, $subject);
2550
  }
2551
  }
 
 
 
 
 
 
2552
  //This is for ISO-2022-JP - Can anyone confirm that this is still neeeded?
2553
  // escape sequence is 'ESC $ B' == 1b 24 42 hex.
2554
  if (strpos($subject, "\x1b\x24\x42") !== false) {
1
  <?php
2
  /*
3
+ $Id: postie-functions.php 1025546 2014-11-14 06:40:07Z WayneAllen $
4
  */
5
 
6
  //to turn on debug output add the following line to wp-config.php
1710
  return $poststatus;
1711
  }
1712
 
 
 
 
 
 
1713
  function filter_Delay(&$content, $message_date = NULL, $offset = 0) {
1714
  $delay = 0;
1715
  $matches = array();
1757
  DebugEcho("tag_Subject: No subject found, using default [1]");
1758
  return(array($defaultTitle, $content));
1759
  }
1760
+ if (strtolower(substr($content, 1, 3)) != "img") {
1761
+
1762
+ $subjectEndIndex = strpos($content, "#", 1);
1763
+ if (!$subjectEndIndex > 0) {
1764
+ DebugEcho("tag_Subject: No subject found, using default [2]");
1765
+ return(array($defaultTitle, $content));
1766
+ }
1767
+ $subject = substr($content, 1, $subjectEndIndex - 1);
1768
+ $content = substr($content, $subjectEndIndex + 1, strlen($content));
1769
+ DebugEcho("tag_Subject: Subject found in body: $subject");
1770
+ return array($subject, $content);
1771
+ } else {
1772
  return(array($defaultTitle, $content));
1773
  }
 
 
 
 
1774
  }
1775
 
1776
  /**
2541
  $subject = $mimeDecodedEmail->headers['subject'];
2542
  DebugEcho(("Predecoded subject: $subject"));
2543
 
2544
+ if ($allow_subject_in_mail) {
 
 
 
 
2545
  list($subject, $content) = tag_Subject($content, $subject);
2546
  }
2547
  }
2548
+ if (!$allow_html_in_subject) {
2549
+ DebugEcho("subject before htmlentities: $subject");
2550
+ $subject = htmlentities($subject, ENT_COMPAT, $message_encoding);
2551
+ DebugEcho("subject after htmlentities: $subject");
2552
+ }
2553
+
2554
  //This is for ISO-2022-JP - Can anyone confirm that this is still neeeded?
2555
  // escape sequence is 'ESC $ B' == 1b 24 42 hex.
2556
  if (strpos($subject, "\x1b\x24\x42") !== false) {
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.6.7
8
  Author: Wayne Allen
9
  Author URI: http://allens-home.com/
10
  License: GPL2
@@ -27,11 +27,11 @@
27
  */
28
 
29
  /*
30
- $Id: postie.php 1020370 2014-11-05 17:14:32Z WayneAllen $
31
  */
32
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
33
 
34
- define('POSTIE_VERSION', '1.6.7');
35
  define("POSTIE_ROOT", dirname(__FILE__));
36
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
37
 
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.6.8
8
  Author: Wayne Allen
9
  Author URI: http://allens-home.com/
10
  License: GPL2
27
  */
28
 
29
  /*
30
+ $Id: postie.php 1025547 2014-11-14 06:42:18Z WayneAllen $
31
  */
32
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
33
 
34
+ define('POSTIE_VERSION', '1.6.8');
35
  define("POSTIE_ROOT", dirname(__FILE__));
36
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
37
 
readme.txt CHANGED
@@ -6,7 +6,7 @@ Plugin URI: http://PostiePlugin.com/
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.0
8
  Tested up to: 4.0
9
- Stable tag: 1.6.6
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -238,6 +238,10 @@ All script, style and body tags are stripped from html emails.
238
  Attachments are now processed in the order they were attached.
239
 
240
  == CHANGELOG ==
 
 
 
 
241
  = 1.6.7 (2014.11.05) =
242
  * Fixed bug where base64 text with utf-8 charset was trying to convert encoding to utf-8
243
 
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.0
8
  Tested up to: 4.0
9
+ Stable tag: 1.6.8
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
238
  Attachments are now processed in the order they were attached.
239
 
240
  == CHANGELOG ==
241
+ = 1.6.8 (2014.11.14) =
242
+ * Fixed bug where the #img tag was being used as the subject if it is the very first line in the email.
243
+ * Fixed bug where the allow subject in body setting was being ignored.
244
+
245
  = 1.6.7 (2014.11.05) =
246
  * Fixed bug where base64 text with utf-8 charset was trying to convert encoding to utf-8
247