Postie - Version 1.9.15

Version Description

(2018-01-25) = * Fix: accommodate extra spaces in content type header when charset is specified

Download this release

Release Info

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

Code changes from version 1.9.14 to 1.9.15

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.14 (2017-12-01) =
39
  * Feature: Additional logging of graphics library in use.
40
 
35
  Attachments are now processed in the order they were attached.
36
 
37
  == CHANGELOG ==
38
+ = 1.9.15 (2018-01-25) =
39
+ * Fix: accommodate extra spaces in content type header when charset is specified
40
+
41
  = 1.9.14 (2017-12-01) =
42
  * Feature: Additional logging of graphics library in use.
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.14
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.15
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
lib/fMailbox.php CHANGED
@@ -175,7 +175,7 @@ class fMailbox {
175
  * @return array The modified $info array
176
  */
177
  static private function handlePart($info, $structure) {
178
- DebugEcho('handlePart: type ' . $structure['type'] . '/' . $structure['subtype']);
179
  if ($structure['type'] == 'multipart') {
180
  foreach ($structure['parts'] as $part) {
181
  $info = self::handlePart($info, $part);
@@ -267,7 +267,7 @@ class fMailbox {
267
  }
268
 
269
  if ($structure['type'] == 'text') {
270
-
271
  $charset = 'iso-8859-1';
272
  foreach ($structure['type_fields'] as $field => $value) {
273
  if (strtolower($field) == 'charset') {
@@ -329,7 +329,6 @@ class fMailbox {
329
  // Attachments or inline content
330
  if ($has_disposition) {
331
  //DebugEcho("handlePart: disposition set to " . $structure['disposition']);
332
-
333
  // This automatically handles primary content that has a content-disposition header on it
334
  if ($structure['disposition'] == 'inline' && $filename === '') {
335
  //DebugEcho("handlePart: inline un-named");
@@ -584,12 +583,14 @@ class fMailbox {
584
  if ($is_additional_info_field) {
585
  $pieces = preg_split('#;\s*#', $value, 2);
586
  $value = $pieces[0];
587
-
 
 
588
  $headers[$header] = array('value' => self::decodeHeader($value));
589
 
590
  $fields = array();
591
  if (!empty($pieces[1])) {
592
- preg_match_all('#(\w+)=("([^"]+)"|([^\s;]+))(?=;|$)#', $pieces[1], $matches, PREG_SET_ORDER);
593
  foreach ($matches as $match) {
594
  $fields[$match[1]] = self::decodeHeader(!empty($match[4]) ? $match[4] : $match[3]);
595
  }
@@ -695,7 +696,7 @@ class fMailbox {
695
  unset($info['raw_headers']);
696
 
697
  if ($convert_newlines) {
698
- DebugEcho("parseMessage: converting newlines");
699
  if (isset($info['text'])) {
700
  $info['text'] = str_replace("\r\n", "\n", $info['text']);
701
  }
@@ -801,6 +802,8 @@ class fMailbox {
801
  $structure['parts'][] = self::parseStructure($sub_content);
802
  }
803
  } else {
 
 
804
  $structure = array(
805
  'type' => $type,
806
  'type_fields' => !empty($headers['content-type']['fields']) ? $headers['content-type']['fields'] : array(),
175
  * @return array The modified $info array
176
  */
177
  static private function handlePart($info, $structure) {
178
+ //DebugEcho('handlePart: type ' . $structure['type'] . '/' . $structure['subtype']);
179
  if ($structure['type'] == 'multipart') {
180
  foreach ($structure['parts'] as $part) {
181
  $info = self::handlePart($info, $part);
267
  }
268
 
269
  if ($structure['type'] == 'text') {
270
+ //DebugDump($structure);
271
  $charset = 'iso-8859-1';
272
  foreach ($structure['type_fields'] as $field => $value) {
273
  if (strtolower($field) == 'charset') {
329
  // Attachments or inline content
330
  if ($has_disposition) {
331
  //DebugEcho("handlePart: disposition set to " . $structure['disposition']);
 
332
  // This automatically handles primary content that has a content-disposition header on it
333
  if ($structure['disposition'] == 'inline' && $filename === '') {
334
  //DebugEcho("handlePart: inline un-named");
583
  if ($is_additional_info_field) {
584
  $pieces = preg_split('#;\s*#', $value, 2);
585
  $value = $pieces[0];
586
+ //DebugEcho("parseHeaders: additional_info: $value");
587
+ //DebugDump($pieces);
588
+
589
  $headers[$header] = array('value' => self::decodeHeader($value));
590
 
591
  $fields = array();
592
  if (!empty($pieces[1])) {
593
+ preg_match_all('#(\w+)\s*=\s*("([^"]+)"|([^\s;]+))(?=;|$)#', $pieces[1], $matches, PREG_SET_ORDER);
594
  foreach ($matches as $match) {
595
  $fields[$match[1]] = self::decodeHeader(!empty($match[4]) ? $match[4] : $match[3]);
596
  }
696
  unset($info['raw_headers']);
697
 
698
  if ($convert_newlines) {
699
+ //DebugEcho("parseMessage: converting newlines");
700
  if (isset($info['text'])) {
701
  $info['text'] = str_replace("\r\n", "\n", $info['text']);
702
  }
802
  $structure['parts'][] = self::parseStructure($sub_content);
803
  }
804
  } else {
805
+ //DebugEcho('parseStructure: content-type');
806
+ //DebugDump($headers['content-type']);
807
  $structure = array(
808
  'type' => $type,
809
  'type_fields' => !empty($headers['content-type']['fields']) ? $headers['content-type']['fields'] : array(),
lib/pSocketConnection.php CHANGED
@@ -32,7 +32,7 @@ class pSocketConnection extends pConnection {
32
  $error_string = '';
33
  $context = stream_context_create();
34
  stream_context_set_option($context, "ssl", "allow_self_signed", true);
35
- //stream_context_set_option($context, "ssl", "verify_peer", false);
36
  stream_context_set_option($context, "ssl", "verify_peer_name", false);
37
  $this->socket = stream_socket_client($connstr, $error_number, $error_string, $this->timeout, STREAM_CLIENT_CONNECT, $context);
38
  DebugEcho("Socket error: $error_number - $error_string");
32
  $error_string = '';
33
  $context = stream_context_create();
34
  stream_context_set_option($context, "ssl", "allow_self_signed", true);
35
+ stream_context_set_option($context, "ssl", "verify_peer", false);
36
  stream_context_set_option($context, "ssl", "verify_peer_name", false);
37
  $this->socket = stream_socket_client($connstr, $error_number, $error_string, $this->timeout, STREAM_CLIENT_CONNECT, $context);
38
  DebugEcho("Socket error: $error_number - $error_string");
postie.class.php CHANGED
@@ -283,8 +283,6 @@ class Postie {
283
  $heights = array();
284
  $img_urls = array();
285
 
286
- $this->show_filters_for('image_downsize'); //possible overrides for image_downsize()
287
-
288
  /*
289
  * Possible enhancement: support all sizes returned by get_intermediate_image_sizes()
290
  */
@@ -1558,9 +1556,9 @@ class Postie {
1558
 
1559
  foreach (array('image/jpeg', 'image/png', 'image/gif') as $mtype) {
1560
  if (!call_user_func(array($implementation, 'supports_mime_type'), $mtype)) {
1561
- DebugEcho("image editor $implementation does not support: $mtype", $force_display);
1562
  } else {
1563
- DebugEcho("image editor $implementation supports: $mtype", $force_display);
1564
  }
1565
  }
1566
  }
@@ -1568,6 +1566,14 @@ class Postie {
1568
 
1569
  DebugEcho("Registered image sizes", $force_display);
1570
  DebugDump(get_intermediate_image_sizes());
 
 
 
 
 
 
 
 
1571
 
1572
  DebugEcho("DISABLE_WP_CRON: " . (defined('DISABLE_WP_CRON') && DISABLE_WP_CRON === true ? 'On' : 'Off'), $force_display);
1573
  DebugEcho("ALTERNATE_WP_CRON: " . (defined('ALTERNATE_WP_CRON') && ALTERNATE_WP_CRON === true ? 'On' : 'Off'), $force_display);
283
  $heights = array();
284
  $img_urls = array();
285
 
 
 
286
  /*
287
  * Possible enhancement: support all sizes returned by get_intermediate_image_sizes()
288
  */
1556
 
1557
  foreach (array('image/jpeg', 'image/png', 'image/gif') as $mtype) {
1558
  if (!call_user_func(array($implementation, 'supports_mime_type'), $mtype)) {
1559
+ DebugEcho("$implementation does not support: $mtype", $force_display);
1560
  } else {
1561
+ DebugEcho("$implementation supports: $mtype", $force_display);
1562
  }
1563
  }
1564
  }
1566
 
1567
  DebugEcho("Registered image sizes", $force_display);
1568
  DebugDump(get_intermediate_image_sizes());
1569
+ $this->show_filters_for('image_downsize');
1570
+ $this->show_filters_for('wp_handle_upload');
1571
+ $this->show_filters_for('wp_get_attachment_thumb_file');
1572
+ $this->show_filters_for('wp_handle_upload_prefilter');
1573
+ $this->show_filters_for('wp_handle_sideload_prefilter');
1574
+ $this->show_filters_for('pre_move_uploaded_file');
1575
+
1576
+ DebugEcho("image memory limit: " . apply_filters('image_memory_limit', WP_MAX_MEMORY_LIMIT), $force_display);
1577
 
1578
  DebugEcho("DISABLE_WP_CRON: " . (defined('DISABLE_WP_CRON') && DISABLE_WP_CRON === true ? 'On' : 'Off'), $force_display);
1579
  DebugEcho("ALTERNATE_WP_CRON: " . (defined('ALTERNATE_WP_CRON') && ALTERNATE_WP_CRON === true ? 'On' : 'Off'), $force_display);
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.14
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL3
@@ -28,14 +28,14 @@
28
  */
29
 
30
  /*
31
- $Id: postie.php 1779782 2017-12-01 23:00:20Z WayneAllen $
32
  */
33
 
34
  if (!defined('WPINC')) {
35
  die; // Exit if accessed directly
36
  }
37
 
38
- define('POSTIE_VERSION', '1.9.14');
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.15
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL3
28
  */
29
 
30
  /*
31
+ $Id: postie.php 1809538 2018-01-25 19:06:03Z WayneAllen $
32
  */
33
 
34
  if (!defined('WPINC')) {
35
  die; // Exit if accessed directly
36
  }
37
 
38
+ define('POSTIE_VERSION', '1.9.15');
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.14
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.14 (2017-12-01) =
111
  * Feature: Additional logging of graphics library in use.
112
 
7
  Requires PHP: 5.3
8
  Requires at least: 4.0
9
  Tested up to: 4.9
10
+ Stable tag: 1.9.15
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.15 (2018-01-25) =
111
+ * Fix: accommodate extra spaces in content type header when charset is specified
112
+
113
  = 1.9.14 (2017-12-01) =
114
  * Feature: Additional logging of graphics library in use.
115