Postie - Version 1.9.37

Version Description

(2019-06-20) = * Update logging to output encoding info * Fix bug where non-image titles are blank

Download this release

Release Info

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

Code changes from version 1.9.35 to 1.9.37

Files changed (5) hide show
  1. docs/Changes.txt +7 -0
  2. docs/Postie.txt +1 -1
  3. postie.class.php +39 -34
  4. postie.php +3 -3
  5. readme.txt +8 -1
docs/Changes.txt CHANGED
@@ -35,6 +35,13 @@ 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.35 (2019-05-31) =
39
  * Allow for a single admin when sending post confirmation emails
40
 
35
  Attachments are now processed in the order they were attached.
36
 
37
  == CHANGELOG ==
38
+ = 1.9.37 (2019-06-20) =
39
+ * Update logging to output encoding info
40
+ * Fix bug where non-image titles are blank
41
+
42
+ = 1.9.36 (2019-06-11) =
43
+ * Fix bug where image titles are blank
44
+
45
  = 1.9.35 (2019-05-31) =
46
  * Allow for a single admin when sending post confirmation emails
47
 
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: 5.2
10
- Stable tag: 1.9.35
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: 5.2
10
+ Stable tag: 1.9.37
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
postie.class.php CHANGED
@@ -59,6 +59,7 @@ class Postie {
59
  }
60
 
61
  $this->postie_environment();
 
62
 
63
  if (function_exists('memory_get_usage')) {
64
  DebugEcho(__("memory at start of email processing: ", 'postie') . memory_get_usage());
@@ -394,6 +395,7 @@ class Postie {
394
  $attachment['ext'] = $mimetype_secondary;
395
  $filename = $filename . '.' . $mimetype_secondary;
396
  $attachment['wp_filename'] = $filename;
 
397
  DebugEcho("save_attachment: blank image extension, changed to $mimetype_secondary ($filename)");
398
  }
399
  DebugEcho("save_attachment: extension '$fileext'");
@@ -570,15 +572,15 @@ class Postie {
570
 
571
  $mediapath = get_attached_file($id);
572
 
 
 
573
  //TODO once WordPress is fixed this can be removed. https://core.trac.wordpress.org/ticket/39521
574
  if (0 === strpos($attachment['mimetype'], 'image/') && $image_meta = wp_read_image_metadata($mediapath)) {
575
- $title = '';
576
  if (trim($image_meta['title']) && !is_numeric(sanitize_title($image_meta['title']))) {
577
  $title = $image_meta['title'];
578
  DebugEcho("media_handle_upload: changing post_title to $title");
579
  }
580
 
581
- $excerpt = '';
582
  if (trim($image_meta['caption'])) {
583
  $excerpt = $image_meta['caption'];
584
  DebugEcho("media_handle_upload: changing post_excerpt to $excerpt");
@@ -1539,6 +1541,40 @@ class Postie {
1539
  return $poster;
1540
  }
1541
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1542
  function postie_environment($force_display = false) {
1543
  global $g_postie_init;
1544
  global $wpdb;
@@ -1780,38 +1816,7 @@ class Postie {
1780
  ?>
1781
  <h2>Encoding</h2>
1782
  <?php
1783
- $default_charset = ini_get('default_charset');
1784
- if (version_compare(phpversion(), '5.6.0', '<')) {
1785
- if (empty($default_charset)) {
1786
- DebugEcho("default_charset: WARNING no default_charset set see http://php.net/manual/en/ini.core.php#ini.default-charset", true);
1787
- } else {
1788
- DebugEcho("default_charset: $default_charset", true);
1789
- }
1790
- } else {
1791
- if (empty($default_charset)) {
1792
- DebugEcho("default_charset: UTF-8 (default)", true);
1793
- } else {
1794
- DebugEcho("default_charset: $default_charset", true);
1795
- }
1796
- }
1797
-
1798
- if (defined('DB_CHARSET')) {
1799
- DebugEcho("DB_CHARSET: " . DB_CHARSET, true);
1800
- } else {
1801
- DebugEcho("DB_CHARSET: undefined (utf8)", true);
1802
- }
1803
-
1804
- if (defined('DB_COLLATE')) {
1805
- $db_collate = DB_COLLATE;
1806
- if (empty($db_collate)) {
1807
- DebugEcho("DB_COLLATE: database default", true);
1808
- } else {
1809
- DebugEcho("DB_COLLATE: " . DB_COLLATE, true);
1810
- }
1811
- }
1812
-
1813
- DebugEcho("WordPress encoding: " . esc_attr(get_option('blog_charset')), true);
1814
- //DebugEcho("Postie encoding: " . $config['message_encoding'], true);
1815
  ?>
1816
 
1817
  <h2>Connect to Mail Host</h2>
59
  }
60
 
61
  $this->postie_environment();
62
+ $this->postie_environment_encoding();
63
 
64
  if (function_exists('memory_get_usage')) {
65
  DebugEcho(__("memory at start of email processing: ", 'postie') . memory_get_usage());
395
  $attachment['ext'] = $mimetype_secondary;
396
  $filename = $filename . '.' . $mimetype_secondary;
397
  $attachment['wp_filename'] = $filename;
398
+ $fileext = $mimetype_secondary;
399
  DebugEcho("save_attachment: blank image extension, changed to $mimetype_secondary ($filename)");
400
  }
401
  DebugEcho("save_attachment: extension '$fileext'");
572
 
573
  $mediapath = get_attached_file($id);
574
 
575
+ $title = $file_array['name'];
576
+ $excerpt = '';
577
  //TODO once WordPress is fixed this can be removed. https://core.trac.wordpress.org/ticket/39521
578
  if (0 === strpos($attachment['mimetype'], 'image/') && $image_meta = wp_read_image_metadata($mediapath)) {
 
579
  if (trim($image_meta['title']) && !is_numeric(sanitize_title($image_meta['title']))) {
580
  $title = $image_meta['title'];
581
  DebugEcho("media_handle_upload: changing post_title to $title");
582
  }
583
 
 
584
  if (trim($image_meta['caption'])) {
585
  $excerpt = $image_meta['caption'];
586
  DebugEcho("media_handle_upload: changing post_excerpt to $excerpt");
1541
  return $poster;
1542
  }
1543
 
1544
+ function postie_environment_encoding($force_display = false) {
1545
+ $default_charset = ini_get('default_charset');
1546
+ if (version_compare(phpversion(), '5.6.0', '<')) {
1547
+ if (empty($default_charset)) {
1548
+ DebugEcho("default_charset: WARNING no default_charset set see http://php.net/manual/en/ini.core.php#ini.default-charset", true);
1549
+ } else {
1550
+ DebugEcho("default_charset: $default_charset", $force_display);
1551
+ }
1552
+ } else {
1553
+ if (empty($default_charset)) {
1554
+ DebugEcho("default_charset: UTF-8 (default)", $force_display);
1555
+ } else {
1556
+ DebugEcho("default_charset: $default_charset", $force_display);
1557
+ }
1558
+ }
1559
+
1560
+ if (defined('DB_CHARSET')) {
1561
+ DebugEcho("DB_CHARSET: " . DB_CHARSET, $force_display);
1562
+ } else {
1563
+ DebugEcho("DB_CHARSET: undefined (utf8)", $force_display);
1564
+ }
1565
+
1566
+ if (defined('DB_COLLATE')) {
1567
+ $db_collate = DB_COLLATE;
1568
+ if (empty($db_collate)) {
1569
+ DebugEcho("DB_COLLATE: database default", $force_display);
1570
+ } else {
1571
+ DebugEcho("DB_COLLATE: " . DB_COLLATE, $force_display);
1572
+ }
1573
+ }
1574
+
1575
+ DebugEcho("WordPress encoding: " . esc_attr(get_option('blog_charset')), $force_display);
1576
+ }
1577
+
1578
  function postie_environment($force_display = false) {
1579
  global $g_postie_init;
1580
  global $wpdb;
1816
  ?>
1817
  <h2>Encoding</h2>
1818
  <?php
1819
+ $this->postie_environment_encoding(true);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1820
  ?>
1821
 
1822
  <h2>Connect to Mail Host</h2>
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.35
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL3
@@ -28,14 +28,14 @@
28
  */
29
 
30
  /*
31
- $Id: postie.php 2098913 2019-05-31 23:55:28Z WayneAllen $
32
  */
33
 
34
  if (!defined('WPINC')) {
35
  die; // Exit if accessed directly
36
  }
37
 
38
- define('POSTIE_VERSION', '1.9.35');
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.37
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL3
28
  */
29
 
30
  /*
31
+ $Id: postie.php 2109869 2019-06-21 02:21:59Z WayneAllen $
32
  */
33
 
34
  if (!defined('WPINC')) {
35
  die; // Exit if accessed directly
36
  }
37
 
38
+ define('POSTIE_VERSION', '1.9.37');
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: 5.2
10
- Stable tag: 1.9.35
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
@@ -107,6 +107,13 @@ 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.35 (2019-05-31) =
111
  * Allow for a single admin when sending post confirmation emails
112
 
7
  Requires PHP: 5.3
8
  Requires at least: 4.0
9
  Tested up to: 5.2
10
+ Stable tag: 1.9.37
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.37 (2019-06-20) =
111
+ * Update logging to output encoding info
112
+ * Fix bug where non-image titles are blank
113
+
114
+ = 1.9.36 (2019-06-11) =
115
+ * Fix bug where image titles are blank
116
+
117
  = 1.9.35 (2019-05-31) =
118
  * Allow for a single admin when sending post confirmation emails
119