Postie - Version 1.4.31

Version Description

(2013.01.25) = * Enhanced category detection to be compatible with Polylang plugin. * Enhanced prerequisite detection. * Now using wp_mail() instead of mail() * WordPress 3.5.1 compatibility

Download this release

Release Info

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

Code changes from version 1.4.30 to 1.4.31

Revision CHANGED
@@ -0,0 +1,2 @@
 
 
1
+ Revision: 658787
2
+ Last Changed Date: 2013-01-24 21:31:40 -0800 (Thu, 24 Jan 2013)
config_form.php CHANGED
@@ -134,7 +134,7 @@
134
  </span>
135
  </th>
136
  <td valign="top">
137
- <br/><input name='postie-settings[mail_server_port]' type="text" id='postie-settings-mail_server_port' value="<?php echo $mail_server_port; ?>" size="6" />
138
  </td>
139
  </tr>
140
  <tr>
@@ -142,24 +142,24 @@
142
  <br />
143
  <span class='recommendation'><?php _e("Should be the same as your normal offset - but this lets you adjust it in cases where that doesn't work.", 'postie'); ?></span>
144
  </th>
145
- <td><input name='postie-settings[time_offset]' type="text" id='postie-settings-time_offset' size="2" value="<?php echo $time_offset; ?>" />
146
  <?php _e('hours', 'postie') ?>
147
 
148
  </td>
149
  </tr>
150
  <tr valign="top">
151
  <th scope="row"><?php _e('Mail Server:', 'postie') ?></th>
152
- <td><input name='postie-settings[mail_server]' type="text" id='postie-settings-mail_server' value="<?php echo $mail_server; ?>" size="40" />
153
  </td>
154
  </tr>
155
  <tr valign="top">
156
  <th width="33%" scope="row"><?php _e('Mail Userid:', 'postie') ?></th>
157
- <td><input name='postie-settings[mail_userid]' type="text" id='postie-settings-mail_userid' value="<?php echo $mail_userid; ?>" size="40" /></td>
158
  </tr>
159
  <tr valign="top">
160
  <th scope="row"><?php _e('Mail Password:', 'postie') ?></th>
161
  <td>
162
- <input name='postie-settings[mail_password]' type="password" id='postie-settings-mail_password' value="<?php echo $mail_password; ?>" size="40" />
163
  </td>
164
  </tr>
165
  <tr>
@@ -291,7 +291,7 @@
291
  <span class='recommendation'><?php _e("This must be a valid WordPress user in the Administrator role. This will be the default poster in some cases.", 'postie'); ?></span>
292
  </th>
293
  <td>
294
- <input name='postie-settings[admin_username]' type="text" id='postie-settings-admin_username' value="<?php echo $admin_username; ?>" size="50" />
295
  </td>
296
  </tr>
297
  </table>
@@ -316,13 +316,13 @@
316
  </span>
317
  </th>
318
  <td>
319
- <input type='text' name='postie-settings[default_post_tags]' id='postie-settings-default_post_tags' value='<?php echo $default_post_tags ?>' />
320
  </td>
321
  </tr>
322
  <tr>
323
  <th width="33%" valign="top" scope="row"><?php _e('Default Title:', 'postie') ?> </th>
324
  <td>
325
- <input name='postie-settings[default_title]' type="text" id='postie-settings-default_title' value="<?php echo $default_title; ?>" size="50" /><br />
326
  </td>
327
  </tr>
328
  <tr>
@@ -342,16 +342,16 @@
342
  <th width="33%" valign="top" scope="row"><?php _e('Tag Of Message Start:', 'postie') ?> <br />
343
  <span class='recommendation'><?php _e('Use to remove any text from a message that the email provider puts at the top of the message', 'postie') ?></span></th>
344
  <td>
345
- <input name='postie-settings[message_start]' type="text" id='postie-settings-message_start' value="<?php echo $message_start; ?>" size="20" /><br />
346
  </td>
347
- </tr>
348
- <tr>
349
  <th width="33%" valign="top" scope="row"><?php _e('Tag Of Message End:', 'postie') ?> <br />
350
  <span class='recommendation'><?php _e('Use to remove any text from a message that the email provider puts at the end of the message', 'postie') ?></span></th>
351
  <td>
352
- <input name='postie-settings[message_end]' type="text" id='postie-settings-message_end' value="<?php echo $message_end; ?>" size="20" /><br />
353
- </td>
354
- </tr>
355
  </table>
356
  <a style='cursor:pointer;' onclick='showAdvanced("message-advanced", "message-advanced-arrow");'><span id="message-advanced-arrow">&#9660;</span> Advanced options</a>
357
  <div id="message-advanced" >
@@ -383,7 +383,7 @@
383
  <tr>
384
  <th width="33%" valign="top" scope="row"><?php _e('Encoding for pages and feeds:', 'postie') ?> </th>
385
  <td>
386
- <input name='postie-settings[message_encoding]' type="text" id='postie-settings-message_encoding' value="<?php echo $message_encoding; ?>" size="10" />
387
  <span class='recommendation'>UTF-8 <?php _e("should handle ISO-8859-1 as well", 'postie'); ?></span>
388
  </td>
389
  </tr>
@@ -407,7 +407,7 @@
407
  <tr>
408
  <th width="33%" valign="top" scope="row"><?php _e('Image Place Holder Tag:', 'postie') ?> </th>
409
  <td>
410
- <input name='postie-settings[image_placeholder]' type="text" id='postie-settings-image_placeholder' value="<?php echo $image_placeholder; ?>" size="50" /><br />
411
  </td>
412
  </tr>
413
  <tr>
@@ -505,7 +505,7 @@
505
  <?php _e('Use the video template 1 for these files types (separated by commas)', 'postie') ?></span> </th>
506
  <td>
507
  <br/><input name='postie-settings[video1types]' type="text" id='postie-settings-video1types'
508
- value="<?php if ($video1types != '') echo $video1types; ?>" size="40" />
509
  </td>
510
  </tr>
511
  <tr><td colspan="2"><hr /></td></tr>
@@ -555,7 +555,7 @@
555
  </th>
556
  <td>
557
  <br/><input name='postie-settings[video2types]' type="text" id='postie-settings-video2types'
558
- value="<?php if ($video2types != '') echo $video2types; ?>" size="40" />
559
  </td>
560
  </tr>
561
  <tr><td colspan="2"><hr /></td></tr>
@@ -604,7 +604,7 @@
604
 
605
  </th>
606
  <td>
607
- <br/><input name='postie-settings[audiotypes]' type="text" id='postie-settings-audiotypes' value="<?php if ($audiotypes != '') echo $audiotypes; ?>" size="40" />
608
  </td>
609
  </tr>
610
  </table>
134
  </span>
135
  </th>
136
  <td valign="top">
137
+ <br/><input name='postie-settings[mail_server_port]' type="text" id='postie-settings-mail_server_port' value="<?php echo esc_attr($mail_server_port); ?>" size="6" />
138
  </td>
139
  </tr>
140
  <tr>
142
  <br />
143
  <span class='recommendation'><?php _e("Should be the same as your normal offset - but this lets you adjust it in cases where that doesn't work.", 'postie'); ?></span>
144
  </th>
145
+ <td><input name='postie-settings[time_offset]' type="text" id='postie-settings-time_offset' size="2" value="<?php echo esc_attr($time_offset); ?>" />
146
  <?php _e('hours', 'postie') ?>
147
 
148
  </td>
149
  </tr>
150
  <tr valign="top">
151
  <th scope="row"><?php _e('Mail Server:', 'postie') ?></th>
152
+ <td><input name='postie-settings[mail_server]' type="text" id='postie-settings-mail_server' value="<?php echo esc_attr($mail_server); ?>" size="40" />
153
  </td>
154
  </tr>
155
  <tr valign="top">
156
  <th width="33%" scope="row"><?php _e('Mail Userid:', 'postie') ?></th>
157
+ <td><input name='postie-settings[mail_userid]' type="text" id='postie-settings-mail_userid' value="<?php echo esc_attr($mail_userid); ?>" size="40" /></td>
158
  </tr>
159
  <tr valign="top">
160
  <th scope="row"><?php _e('Mail Password:', 'postie') ?></th>
161
  <td>
162
+ <input name='postie-settings[mail_password]' type="password" id='postie-settings-mail_password' value="<?php echo esc_attr($mail_password); ?>" size="40" />
163
  </td>
164
  </tr>
165
  <tr>
291
  <span class='recommendation'><?php _e("This must be a valid WordPress user in the Administrator role. This will be the default poster in some cases.", 'postie'); ?></span>
292
  </th>
293
  <td>
294
+ <input name='postie-settings[admin_username]' type="text" id='postie-settings-admin_username' value="<?php echo esc_attr($admin_username); ?>" size="50" />
295
  </td>
296
  </tr>
297
  </table>
316
  </span>
317
  </th>
318
  <td>
319
+ <input type='text' name='postie-settings[default_post_tags]' id='postie-settings-default_post_tags' value='<?php echo esc_attr($default_post_tags) ?>' />
320
  </td>
321
  </tr>
322
  <tr>
323
  <th width="33%" valign="top" scope="row"><?php _e('Default Title:', 'postie') ?> </th>
324
  <td>
325
+ <input name='postie-settings[default_title]' type="text" id='postie-settings-default_title' value="<?php echo esc_attr($default_title); ?>" size="50" /><br />
326
  </td>
327
  </tr>
328
  <tr>
342
  <th width="33%" valign="top" scope="row"><?php _e('Tag Of Message Start:', 'postie') ?> <br />
343
  <span class='recommendation'><?php _e('Use to remove any text from a message that the email provider puts at the top of the message', 'postie') ?></span></th>
344
  <td>
345
+ <input name='postie-settings[message_start]' type="text" id='postie-settings-message_start' value="<?php echo esc_attr($message_start); ?>" size="50" /><br />
346
  </td>
347
+ </tr>
348
+ <tr>
349
  <th width="33%" valign="top" scope="row"><?php _e('Tag Of Message End:', 'postie') ?> <br />
350
  <span class='recommendation'><?php _e('Use to remove any text from a message that the email provider puts at the end of the message', 'postie') ?></span></th>
351
  <td>
352
+ <input name='postie-settings[message_end]' type="text" id='postie-settings-message_end' value="<?php echo esc_attr($message_end); ?>" size="50" /><br />
353
+ </td>
354
+ </tr>
355
  </table>
356
  <a style='cursor:pointer;' onclick='showAdvanced("message-advanced", "message-advanced-arrow");'><span id="message-advanced-arrow">&#9660;</span> Advanced options</a>
357
  <div id="message-advanced" >
383
  <tr>
384
  <th width="33%" valign="top" scope="row"><?php _e('Encoding for pages and feeds:', 'postie') ?> </th>
385
  <td>
386
+ <input name='postie-settings[message_encoding]' type="text" id='postie-settings-message_encoding' value="<?php echo esc_attr($message_encoding); ?>" size="10" />
387
  <span class='recommendation'>UTF-8 <?php _e("should handle ISO-8859-1 as well", 'postie'); ?></span>
388
  </td>
389
  </tr>
407
  <tr>
408
  <th width="33%" valign="top" scope="row"><?php _e('Image Place Holder Tag:', 'postie') ?> </th>
409
  <td>
410
+ <input name='postie-settings[image_placeholder]' type="text" id='postie-settings-image_placeholder' value="<?php echo esc_attr($image_placeholder); ?>" size="50" /><br />
411
  </td>
412
  </tr>
413
  <tr>
505
  <?php _e('Use the video template 1 for these files types (separated by commas)', 'postie') ?></span> </th>
506
  <td>
507
  <br/><input name='postie-settings[video1types]' type="text" id='postie-settings-video1types'
508
+ value="<?php if ($video1types != '') echo esc_attr($video1types); ?>" size="40" />
509
  </td>
510
  </tr>
511
  <tr><td colspan="2"><hr /></td></tr>
555
  </th>
556
  <td>
557
  <br/><input name='postie-settings[video2types]' type="text" id='postie-settings-video2types'
558
+ value="<?php if ($video2types != '') echo esc_attr($video2types); ?>" size="40" />
559
  </td>
560
  </tr>
561
  <tr><td colspan="2"><hr /></td></tr>
604
 
605
  </th>
606
  <td>
607
+ <br/><input name='postie-settings[audiotypes]' type="text" id='postie-settings-audiotypes' value="<?php echo esc_attr($audiotypes); ?>" size="40" />
608
  </td>
609
  </tr>
610
  </table>
docs/Changes.txt CHANGED
@@ -10,8 +10,14 @@ All script, style and body tags are stripped from html emails.
10
  Attachments are now processed in the order they were attached.
11
 
12
  == CHANGELOG ==
 
 
 
 
 
 
13
  = 1.4.30 (2013.01.22) =
14
- * Fixed a bug that caused activation to fail or show a blank page.
15
  * Fixed bug where WP media upload rejects a file.
16
  * Added a check for mbstring.
17
  * Fixed bug when attachment names were only supplied via d_parameters.
10
  Attachments are now processed in the order they were attached.
11
 
12
  == CHANGELOG ==
13
+ = 1.4.31 (2013.01.25) =
14
+ * Enhanced category detection to be compatible with Polylang plugin.
15
+ * Enhanced prerequisite detection.
16
+ * Now using wp_mail() instead of mail()
17
+ * WordPress 3.5.1 compatibility
18
+
19
  = 1.4.30 (2013.01.22) =
20
+ * Fixed bug that caused activation to fail or show a blank page.
21
  * Fixed bug where WP media upload rejects a file.
22
  * Added a check for mbstring.
23
  * Fixed bug when attachment names were only supplied via d_parameters.
docs/Postie.txt CHANGED
@@ -5,8 +5,8 @@ Author URI: http://allens-home.com/
5
  Plugin URI: http://PostiePlugin.com/
6
  Tags: e-mail, email
7
  Requires at least: 3.0
8
- Tested up to: 3.5
9
- Stable tag: 1.4.30
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
5
  Plugin URI: http://PostiePlugin.com/
6
  Tags: e-mail, email
7
  Requires at least: 3.0
8
+ Tested up to: 3.5.1
9
+ Stable tag: 1.4.31
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
docs/TODO.txt CHANGED
@@ -1,7 +1,7 @@
1
  provide a location for custom icons. update docs about location.
2
  reply logic not adding to comments
3
  hide/disable config options that don't apply
4
- code to set featured image
5
  handle condition where only one of text/plain & text/html is supplied, but Preferred Text Type is set to the opposite.
6
 
7
  replace native imap with flourish
1
  provide a location for custom icons. update docs about location.
2
  reply logic not adding to comments
3
  hide/disable config options that don't apply
4
+ code to set featured image. Global setting (first picture is featured). Featured tag to enable per email. Enhance #img#
5
  handle condition where only one of text/plain & text/html is supplied, but Preferred Text Type is set to the opposite.
6
 
7
  replace native imap with flourish
postie-functions.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  /*
4
- $Id: postie-functions.php 657225 2013-01-23 04:42:31Z WayneAllen $
5
  */
6
 
7
  //to turn on debug output add the following line to wp-config.php
@@ -120,7 +120,7 @@ function tag_Date(&$content, $message_date) {
120
 
121
  function CreatePost($poster, $mimeDecodedEmail, $post_id, &$is_reply, $config) {
122
 
123
- $fulldebug = true;
124
 
125
  extract($config);
126
 
@@ -323,6 +323,9 @@ function PostEmail($poster, $mimeDecodedEmail, $config) {
323
 
324
  $details = apply_filters('postie_post', $details);
325
 
 
 
 
326
  if (empty($details)) {
327
  // It is possible that the filter has removed the post, in which case, it should not be posted.
328
  // And if we created a placeholder post (because this was not a reply to an existing post),
@@ -1749,16 +1752,18 @@ function filter_PreferedText($mimeDecodedEmail, $preferTextType) {
1749
  * It accepts an object containing the entire message
1750
  */
1751
  function MailToRecipients(&$mail_content, $testEmail = false, $recipients = array(), $returnToSender, $reject = true) {
 
1752
  if ($testEmail) {
1753
- return;
1754
  }
1755
  $user = get_userdata('1');
1756
  $myname = $user->user_nicename;
1757
  $myemailadd = get_option("admin_email");
1758
  $blogname = get_option("blogname");
1759
  $blogurl = get_option("siteurl");
1760
- //array_push($recipients, $myemailadd);
1761
  if (count($recipients) == 0) {
 
1762
  return false;
1763
  }
1764
 
@@ -1777,25 +1782,15 @@ function MailToRecipients(&$mail_content, $testEmail = false, $recipients = arra
1777
  }
1778
  // Set email subject
1779
  if ($reject) {
 
1780
  $alert_subject = $blogname . ": Unauthorized Post Attempt from $from";
1781
- if ($mail_content->ctype_parameters['boundary']) {
1782
  $boundary = $mail_content->ctype_parameters["boundary"];
1783
  } else {
1784
  $boundary = uniqid("B_");
1785
  }
1786
  // Set sender details
1787
- /*
1788
- if (isset($mail_content->headers["mime-version"])) {
1789
- $headers .= "Mime-Version: ". $mail_content->headers["mime-version"] . "\r\n";
1790
- }
1791
- if (isset($mail_content->headers["content-type"])) {
1792
- $headers .= "Content-Type: ". $mail_content->headers["content-type"] . "\r\n";
1793
- }
1794
- */
1795
-
1796
  $headers.="Content-Type:multipart/alternative; boundary=\"$boundary\"\r\n";
1797
- // SDM 20041123
1798
- // construct mail message
1799
  $message = "An unauthorized message has been sent to $blogname.\n";
1800
  $message .= "Sender: $from\n";
1801
  $message .= "Subject: $subject\n";
@@ -1827,13 +1822,12 @@ function MailToRecipients(&$mail_content, $testEmail = false, $recipients = arra
1827
  $mailtext .= $part->body;
1828
  }
1829
  } else {
 
1830
  $alert_subject = "Successfully posted to $blogname";
1831
  $mailtext = "Your post '$subject' has been successfully published to $blogname <$blogurl>.\n";
1832
  }
1833
 
1834
-
1835
- // Send message
1836
- mail($myemailadd, $alert_subject, $mailtext, $headers);
1837
 
1838
  return true;
1839
  }
@@ -2239,7 +2233,7 @@ function tag_Excerpt(&$content, $filterNewLines, $convertNewLines) {
2239
  }
2240
 
2241
  /**
2242
- * This function determines categories for the post
2243
  * @return array
2244
  */
2245
  function tag_categories(&$subject, $defaultCategory) {
@@ -2303,7 +2297,7 @@ function lookup_category($trial_category) {
2303
  } elseif ($found_category = $wpdb->get_var($sql_sub_name)) {
2304
  //then cateogry is a start of a name and found
2305
  }
2306
- return $found_category;
2307
  }
2308
 
2309
  /**
@@ -2364,7 +2358,7 @@ function BuildTextArea($label, $id, $current_value, $recommendation = NULL) {
2364
  $html.="</th>";
2365
 
2366
  $html .="<td><br /><textarea cols=40 rows=3 name='$id' id='$id'>";
2367
- $current_value = preg_split("/[,\r\n]+/", trim($current_value));
2368
  if (is_array($current_value)) {
2369
  foreach ($current_value as $item) {
2370
  $html .= "$item\n";
1
  <?php
2
 
3
  /*
4
+ $Id: postie-functions.php 659001 2013-01-25 22:49:55Z WayneAllen $
5
  */
6
 
7
  //to turn on debug output add the following line to wp-config.php
120
 
121
  function CreatePost($poster, $mimeDecodedEmail, $post_id, &$is_reply, $config) {
122
 
123
+ $fulldebug = false;
124
 
125
  extract($config);
126
 
323
 
324
  $details = apply_filters('postie_post', $details);
325
 
326
+ DebugEcho(("Post postie_post filter"));
327
+ DebugDump($details);
328
+
329
  if (empty($details)) {
330
  // It is possible that the filter has removed the post, in which case, it should not be posted.
331
  // And if we created a placeholder post (because this was not a reply to an existing post),
1752
  * It accepts an object containing the entire message
1753
  */
1754
  function MailToRecipients(&$mail_content, $testEmail = false, $recipients = array(), $returnToSender, $reject = true) {
1755
+ DebugEcho("send mail");
1756
  if ($testEmail) {
1757
+ return false;
1758
  }
1759
  $user = get_userdata('1');
1760
  $myname = $user->user_nicename;
1761
  $myemailadd = get_option("admin_email");
1762
  $blogname = get_option("blogname");
1763
  $blogurl = get_option("siteurl");
1764
+
1765
  if (count($recipients) == 0) {
1766
+ DebugEcho("send mail: no recipients");
1767
  return false;
1768
  }
1769
 
1782
  }
1783
  // Set email subject
1784
  if ($reject) {
1785
+ DebugEcho("send mail: sending reject mail");
1786
  $alert_subject = $blogname . ": Unauthorized Post Attempt from $from";
1787
+ if (is_array($mail_content->ctype_parameters) && array_key_exists('boundary', $mail_content->ctype_parameters) && $mail_content->ctype_parameters['boundary']) {
1788
  $boundary = $mail_content->ctype_parameters["boundary"];
1789
  } else {
1790
  $boundary = uniqid("B_");
1791
  }
1792
  // Set sender details
 
 
 
 
 
 
 
 
 
1793
  $headers.="Content-Type:multipart/alternative; boundary=\"$boundary\"\r\n";
 
 
1794
  $message = "An unauthorized message has been sent to $blogname.\n";
1795
  $message .= "Sender: $from\n";
1796
  $message .= "Subject: $subject\n";
1822
  $mailtext .= $part->body;
1823
  }
1824
  } else {
1825
+ DebugEcho("send mail: sending success mail");
1826
  $alert_subject = "Successfully posted to $blogname";
1827
  $mailtext = "Your post '$subject' has been successfully published to $blogname <$blogurl>.\n";
1828
  }
1829
 
1830
+ wp_mail($myemailadd, $alert_subject, $mailtext, $headers);
 
 
1831
 
1832
  return true;
1833
  }
2233
  }
2234
 
2235
  /**
2236
+ * This function determines the categories ids for the post
2237
  * @return array
2238
  */
2239
  function tag_categories(&$subject, $defaultCategory) {
2297
  } elseif ($found_category = $wpdb->get_var($sql_sub_name)) {
2298
  //then cateogry is a start of a name and found
2299
  }
2300
+ return intval($found_category); //force to integer
2301
  }
2302
 
2303
  /**
2358
  $html.="</th>";
2359
 
2360
  $html .="<td><br /><textarea cols=40 rows=3 name='$id' id='$id'>";
2361
+ $current_value = preg_split("/[,\r\n]+/", esc_attr(trim($current_value)));
2362
  if (is_array($current_value)) {
2363
  foreach ($current_value as $item) {
2364
  $html .= "$item\n";
postie.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Postie
5
  Plugin URI: http://PostiePlugin.com/
6
  Description: Signifigantly upgrades the posting by mail features of Word Press (See <a href='options-general.php?page=postie/postie.php'>Settings and options</a>) to configure your e-mail settings. See the <a href='http://wordpress.org/extend/plugins/postie/other_notes'>Readme</a> for usage. Visit the <a href='http://wordpress.org/support/plugin/postie'>postie forum</a> for support.
7
- Version: 1.4.30
8
  Author: Wayne Allen
9
  Author URI: http://allens-home.com/
10
  License: GPL2
@@ -27,7 +27,7 @@
27
  */
28
 
29
  /*
30
- $Id: postie.php 657225 2013-01-23 04:42:31Z WayneAllen $
31
  */
32
 
33
  define("POSTIE_ROOT", dirname(__FILE__));
@@ -79,6 +79,7 @@ if (is_admin()) {
79
  * Note that you can't do any output during this funtion or activation
80
  * will fail on some systems. This means no DebugEcho, EchoInfo or DebugDump.
81
  */
 
82
  function activate_postie() {
83
  static $init = false;
84
  $options = get_option('postie-settings');
@@ -133,19 +134,28 @@ function postie_warnings() {
133
  add_action('admin_notices', 'postie_enter_info');
134
  }
135
 
136
- if (!function_exists('imap_mime_header_decode') && array_key_exists('activate', $_GET) && $_GET['activate'] == true) {
 
137
 
138
  function postie_imap_warning() {
139
  echo "<div id='postie-imap-warning' class='error'><p><strong>";
140
- echo __('Warning: the IMAP php extension is not installed.', 'postie');
141
- echo __('Postie may not function correctly without this extension (especially for non-English messages).', 'postie');
142
- echo "</strong> ";
143
- //echo __('Warning: the IMAP php extension is not installed. Postie may not function correctly without this extension (especially for non-English messages) .', 'postie')."</strong> ".
144
- echo sprintf(__('Please see the <a href="%1$s">FAQ </a> for more information.'), "options-general.php?page=postie/postie.php", 'postie') . "</p></div> ";
145
  }
146
 
147
  add_action('admin_notices', 'postie_imap_warning');
148
  }
 
 
 
 
 
 
 
 
 
 
 
149
  }
150
 
151
  function disable_kses_content() {
4
  Plugin Name: Postie
5
  Plugin URI: http://PostiePlugin.com/
6
  Description: Signifigantly upgrades the posting by mail features of Word Press (See <a href='options-general.php?page=postie/postie.php'>Settings and options</a>) to configure your e-mail settings. See the <a href='http://wordpress.org/extend/plugins/postie/other_notes'>Readme</a> for usage. Visit the <a href='http://wordpress.org/support/plugin/postie'>postie forum</a> for support.
7
+ Version: 1.4.31
8
  Author: Wayne Allen
9
  Author URI: http://allens-home.com/
10
  License: GPL2
27
  */
28
 
29
  /*
30
+ $Id: postie.php 659001 2013-01-25 22:49:55Z WayneAllen $
31
  */
32
 
33
  define("POSTIE_ROOT", dirname(__FILE__));
79
  * Note that you can't do any output during this funtion or activation
80
  * will fail on some systems. This means no DebugEcho, EchoInfo or DebugDump.
81
  */
82
+
83
  function activate_postie() {
84
  static $init = false;
85
  $options = get_option('postie-settings');
134
  add_action('admin_notices', 'postie_enter_info');
135
  }
136
 
137
+ $p = strtolower($config['input_protocol']);
138
+ if (!function_exists('imap_mime_header_decode') && ($p == 'imap' || $p == 'imap-ssl' || $p = 'pop-ssl')) {
139
 
140
  function postie_imap_warning() {
141
  echo "<div id='postie-imap-warning' class='error'><p><strong>";
142
+ echo __('Warning: the IMAP php extension is not installed. Postie can not use IMAP, IMAP-SSL or POP-SSL without this extension.', 'postie');
143
+ echo "</strong></p></div>";
 
 
 
144
  }
145
 
146
  add_action('admin_notices', 'postie_imap_warning');
147
  }
148
+
149
+ if (!function_exists('mb_detect_encoding')) {
150
+
151
+ function postie_mbstring_warning() {
152
+ echo "<div id='postie-mbstring-warning' class='error'><p><strong>";
153
+ echo __('Warning: the Multibyte String php extension (mbstring) is not installed. Postie will not function without this extension.', 'postie');
154
+ echo "</strong></p></div>";
155
+ }
156
+
157
+ add_action('admin_notices', 'postie_mbstring_warning');
158
+ }
159
  }
160
 
161
  function disable_kses_content() {
postie_test.php CHANGED
@@ -38,12 +38,21 @@ $images = array("Test.png", "Test.jpg", "Test.gif");
38
 
39
  <br/>
40
  <h2>International support</h2>
41
- <p><i><?php _e('Only required for international character set support', 'postie') ?></i></p>
42
  <?php
43
- EchoInfo("iconv: " . ((HasIconvInstalled()) ? __('yes', 'postie') : __('no', 'postie')));
44
- EchoInfo("imap (required for subjects): " . ((function_exists('imap_mime_header_decode')) ? __('yes', 'postie') : __('no', 'postie')));
 
 
 
 
 
 
 
 
 
 
45
  if (HasMbStringInstalled()) {
46
- EchoInfo("mbstring: yes");
47
  } else {
48
  EchoInfo("<b>Warning!</b> Postie requires that mbstring be enabled.");
49
  }
38
 
39
  <br/>
40
  <h2>International support</h2>
 
41
  <?php
42
+ if (HasIconvInstalled()) {
43
+ EchoInfo("iconv: installed");
44
+ } else {
45
+ EchoInfo("<b>Warning!</b> Postie requires that iconv be enabled.");
46
+ }
47
+
48
+ if (function_exists('imap_mime_header_decode')) {
49
+ EchoInfo("imap: installed");
50
+ } else {
51
+ EchoInfo("<b>Warning!</b> Postie requires that imap be enabled.");
52
+ }
53
+
54
  if (HasMbStringInstalled()) {
55
+ EchoInfo("mbstring: installed");
56
  } else {
57
  EchoInfo("<b>Warning!</b> Postie requires that mbstring be enabled.");
58
  }
readme.txt CHANGED
@@ -5,8 +5,8 @@ Author URI: http://allens-home.com/
5
  Plugin URI: http://PostiePlugin.com/
6
  Tags: e-mail, email
7
  Requires at least: 3.0
8
- Tested up to: 3.5
9
- Stable tag: 1.4.30
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -416,11 +416,17 @@ All script, style and body tags are stripped from html emails.
416
  Attachments are now processed in the order they were attached.
417
 
418
  == CHANGELOG ==
 
 
 
 
 
 
419
  = 1.4.30 (2013.01.22) =
420
- * Fixed a bug that caused activation to fail or show a blank page.
421
  * Fixed bug where WP media upload rejects a file.
422
  * Added a check for mbstring.
423
- * Fixed bug when attachment names were only supplied via d_parameters
424
 
425
  = 1.4.29 (2013.01.19) =
426
  * Fixed bug where manually running Postie worked, but calling get_mail.php directly did not.
5
  Plugin URI: http://PostiePlugin.com/
6
  Tags: e-mail, email
7
  Requires at least: 3.0
8
+ Tested up to: 3.5.1
9
+ Stable tag: 1.4.31
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
416
  Attachments are now processed in the order they were attached.
417
 
418
  == CHANGELOG ==
419
+ = 1.4.31 (2013.01.25) =
420
+ * Enhanced category detection to be compatible with Polylang plugin.
421
+ * Enhanced prerequisite detection.
422
+ * Now using wp_mail() instead of mail()
423
+ * WordPress 3.5.1 compatibility
424
+
425
  = 1.4.30 (2013.01.22) =
426
+ * Fixed bug that caused activation to fail or show a blank page.
427
  * Fixed bug where WP media upload rejects a file.
428
  * Added a check for mbstring.
429
+ * Fixed bug when attachment names were only supplied via d_parameters.
430
 
431
  = 1.4.29 (2013.01.19) =
432
  * Fixed bug where manually running Postie worked, but calling get_mail.php directly did not.
test/postie-functionsTest.php CHANGED
@@ -312,22 +312,22 @@ class postiefunctionsTest extends PHPUnit_Framework_TestCase {
312
  $this->assertEquals("default", $c[0]);
313
  $this->assertEquals("-not a category- test", $s);
314
 
315
- $wpdb->t_get_var = "general";
316
  $s = "general: test";
317
  $c = tag_categories($s, "default");
318
- $this->assertEquals("general", $c[0]);
319
  $this->assertEquals("test", $s);
320
 
321
- $wpdb->t_get_var = "general";
322
  $s = "[general] test";
323
  $c = tag_categories($s, "default");
324
- $this->assertEquals("general", $c[0]);
325
  $this->assertEquals("test", $s);
326
 
327
- $wpdb->t_get_var = "general";
328
  $s = "-general- test";
329
  $c = tag_categories($s, "default");
330
- $this->assertEquals("general", $c[0]);
331
  $this->assertEquals("test", $s);
332
 
333
  $wpdb->t_get_var = "";
@@ -336,7 +336,7 @@ class postiefunctionsTest extends PHPUnit_Framework_TestCase {
336
  $this->assertEquals("default", $c[0]);
337
  $this->assertEquals("specific: test", $s);
338
 
339
- $wpdb->t_get_var = array("1", "1");
340
  $s = "[1] [1] test";
341
  $c = tag_categories($s, "default");
342
  $this->assertEquals(2, count($c));
@@ -344,10 +344,10 @@ class postiefunctionsTest extends PHPUnit_Framework_TestCase {
344
  $this->assertEquals("1", $c[1]);
345
  $this->assertEquals("test", $s);
346
 
347
- $wpdb->t_get_var = array(null, null, null, "general");
348
  $s = "[general] test: with colon";
349
  $c = tag_categories($s, "default");
350
- $this->assertEquals("general", $c[0]);
351
  $this->assertEquals("test: with colon", $s);
352
  }
353
 
312
  $this->assertEquals("default", $c[0]);
313
  $this->assertEquals("-not a category- test", $s);
314
 
315
+ $wpdb->t_get_var = 1;
316
  $s = "general: test";
317
  $c = tag_categories($s, "default");
318
+ $this->assertEquals(1, $c[0]);
319
  $this->assertEquals("test", $s);
320
 
321
+ $wpdb->t_get_var = 1;
322
  $s = "[general] test";
323
  $c = tag_categories($s, "default");
324
+ $this->assertEquals(1, $c[0]);
325
  $this->assertEquals("test", $s);
326
 
327
+ $wpdb->t_get_var = 1;
328
  $s = "-general- test";
329
  $c = tag_categories($s, "default");
330
+ $this->assertEquals(1, $c[0]);
331
  $this->assertEquals("test", $s);
332
 
333
  $wpdb->t_get_var = "";
336
  $this->assertEquals("default", $c[0]);
337
  $this->assertEquals("specific: test", $s);
338
 
339
+ $wpdb->t_get_var = array(1, 1);
340
  $s = "[1] [1] test";
341
  $c = tag_categories($s, "default");
342
  $this->assertEquals(2, count($c));
344
  $this->assertEquals("1", $c[1]);
345
  $this->assertEquals("test", $s);
346
 
347
+ $wpdb->t_get_var = array(null, null, null, 1);
348
  $s = "[general] test: with colon";
349
  $c = tag_categories($s, "default");
350
+ $this->assertEquals(1, $c[0]);
351
  $this->assertEquals("test: with colon", $s);
352
  }
353
 
test/wpstub.php CHANGED
@@ -140,4 +140,8 @@ function is_wp_error() {
140
  function sanitize_title($title){
141
  return $title;
142
  }
 
 
 
 
143
  ?>
140
  function sanitize_title($title){
141
  return $title;
142
  }
143
+
144
+ function get_temp_dir(){
145
+ return sys_get_temp_dir();
146
+ }
147
  ?>