Postie - Version 1.6.7

Version Description

(2014.11.05) = * Fixed bug where base64 text with utf-8 charset was trying to convert encoding to utf-8

Download this release

Release Info

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

Code changes from version 1.6.6 to 1.6.7

Files changed (4) hide show
  1. docs/Changes.txt +3 -0
  2. postie-functions.php +12 -6
  3. postie.php +3 -3
  4. readme.txt +3 -0
docs/Changes.txt CHANGED
@@ -27,6 +27,9 @@ 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.6 (2014.10.29) =
31
  * Add additional debugging to isValidSmtpServer
32
  * Add Japanese translation
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
+
33
  = 1.6.6 (2014.10.29) =
34
  * Add additional debugging to isValidSmtpServer
35
  * Add Japanese translation
postie-functions.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /*
3
- $Id: postie-functions.php 1016279 2014-10-29 22:46:52Z WayneAllen $
4
  */
5
 
6
  //to turn on debug output add the following line to wp-config.php
@@ -1657,14 +1657,20 @@ function DecodeBase64Part(&$part) {
1657
  if (strtolower($part->headers['content-transfer-encoding']) == 'base64') {
1658
  DebugEcho("DecodeBase64Part: base64 detected");
1659
  //DebugDump($part);
 
1660
  if (isset($part->disposition) && $part->disposition == 'attachment') {
1661
- $part->body = base64_decode($part->body);
1662
  } else if (property_exists($part, 'ctype_parameters') && is_array($part->ctype_parameters) && array_key_exists('charset', $part->ctype_parameters)) {
1663
- $part->body = iconv($part->ctype_parameters['charset'], 'UTF-8//TRANSLIT', base64_decode($part->body));
1664
- DebugEcho("convertef from: " . $part->ctype_parameters['charset']);
1665
- $part->ctype_parameters['charset'] = 'default'; //so we don't double decode
 
 
 
 
 
1666
  } else {
1667
- $part->body = base64_decode($part->body);
1668
  }
1669
  $part->headers['content-transfer-encoding'] = '';
1670
  }
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
1657
  if (strtolower($part->headers['content-transfer-encoding']) == 'base64') {
1658
  DebugEcho("DecodeBase64Part: base64 detected");
1659
  //DebugDump($part);
1660
+ $decoded = base64_decode($part->body);
1661
  if (isset($part->disposition) && $part->disposition == 'attachment') {
1662
+ $part->body = $decoded;
1663
  } else if (property_exists($part, 'ctype_parameters') && is_array($part->ctype_parameters) && array_key_exists('charset', $part->ctype_parameters)) {
1664
+ $charset = strtolower($part->ctype_parameters['charset']);
1665
+ if ($charset != 'utf-8') {
1666
+ DebugEcho("converted from: " . $charset);
1667
+ $part->body = iconv($charset, 'UTF-8//TRANSLIT', $decoded);
1668
+ $part->ctype_parameters['charset'] = 'default'; //so we don't double decode
1669
+ } else {
1670
+ $part->body = $decoded;
1671
+ }
1672
  } else {
1673
+ $part->body = $decoded;
1674
  }
1675
  $part->headers['content-transfer-encoding'] = '';
1676
  }
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.6
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 1016279 2014-10-29 22:46:52Z WayneAllen $
31
  */
32
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
33
 
34
- define('POSTIE_VERSION', '1.6.6');
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.7
8
  Author: Wayne Allen
9
  Author URI: http://allens-home.com/
10
  License: GPL2
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
 
readme.txt CHANGED
@@ -238,6 +238,9 @@ 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.6 (2014.10.29) =
242
  * Add additional debugging to isValidSmtpServer
243
  * Add Japanese translation
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
+
244
  = 1.6.6 (2014.10.29) =
245
  * Add additional debugging to isValidSmtpServer
246
  * Add Japanese translation