Version Description
(2015-08-06) = * If featured image is enabled, the featured image will no longer appear in the post.
Download this release
Release Info
Developer | WayneAllen |
Plugin | Postie |
Version | 1.7.5 |
Comparing to | |
See all releases |
Code changes from version 1.7.4 to 1.7.5
- docs/Changes.txt +3 -0
- docs/Postie.txt +2 -2
- postie-functions.php +41 -41
- postie.php +3 -3
- readme.txt +5 -2
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.7.4 (2015-07-30) =
|
31 |
* Added additional output if wp_insert_post() fails
|
32 |
* Fixed image upload failure when image filename doesn't have an extension
|
27 |
Attachments are now processed in the order they were attached.
|
28 |
|
29 |
== CHANGELOG ==
|
30 |
+
= 1.7.5 (2015-08-06) =
|
31 |
+
* If featured image is enabled, the featured image will no longer appear in the post.
|
32 |
+
|
33 |
= 1.7.4 (2015-07-30) =
|
34 |
* Added additional output if wp_insert_post() fails
|
35 |
* Fixed image upload failure when image filename doesn't have an extension
|
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, post-by-email
|
7 |
Requires at least: 3.3.0
|
8 |
-
Tested up to: 4.2.
|
9 |
-
Stable tag: 1.7.
|
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, post-by-email
|
7 |
Requires at least: 3.3.0
|
8 |
+
Tested up to: 4.2.4
|
9 |
+
Stable tag: 1.7.5
|
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
|
4 |
*/
|
5 |
|
6 |
//to turn on debug output add the following line to wp-config.php
|
@@ -988,7 +988,7 @@ function GetContent($part, &$attachments, $post_id, $poster, $config) {
|
|
988 |
|
989 |
//look for banned file names
|
990 |
if (property_exists($part, 'ctype_parameters') && is_array($part->ctype_parameters) && array_key_exists('name', $part->ctype_parameters)) {
|
991 |
-
if (isBannedFileName($part->ctype_parameters['name'], $banned_files_list)) {
|
992 |
DebugEcho("GetContent: found banned filename");
|
993 |
return NULL;
|
994 |
}
|
@@ -1000,7 +1000,7 @@ function GetContent($part, &$attachments, $post_id, $poster, $config) {
|
|
1000 |
} else {
|
1001 |
DebugEcho("GetContent: decoding application/octet-stream");
|
1002 |
$mimeDecodedEmail = DecodeMIMEMail($part->body);
|
1003 |
-
filter_PreferedText($mimeDecodedEmail, $prefer_text_type);
|
1004 |
foreach ($mimeDecodedEmail->parts as $section) {
|
1005 |
$meta_return .= GetContent($section, $attachments, $post_id, $poster, $config);
|
1006 |
}
|
@@ -1010,7 +1010,7 @@ function GetContent($part, &$attachments, $post_id, $poster, $config) {
|
|
1010 |
if (property_exists($part, "ctype_primary") && $part->ctype_primary == "multipart" && $part->ctype_secondary == "appledouble") {
|
1011 |
DebugEcho("GetContent: multipart appledouble");
|
1012 |
$mimeDecodedEmail = DecodeMIMEMail("Content-Type: multipart/mixed; boundary=" . $part->ctype_parameters["boundary"] . "\n" . $part->body);
|
1013 |
-
filter_PreferedText($mimeDecodedEmail, $prefer_text_type);
|
1014 |
filter_AppleFile($mimeDecodedEmail);
|
1015 |
foreach ($mimeDecodedEmail->parts as $section) {
|
1016 |
$meta_return .= GetContent($section, $attachments, $post_id, $poster, $config);
|
@@ -1047,11 +1047,11 @@ function GetContent($part, &$attachments, $post_id, $poster, $config) {
|
|
1047 |
$mimetype_secondary = $mimeparts[1];
|
1048 |
} else {
|
1049 |
DebugEcho("GetContent: secondary lookup failed, checking configured extensions");
|
1050 |
-
if (in_array($fileext, $audiotypes)) {
|
1051 |
DebugEcho("GetContent: found audio extension");
|
1052 |
$mimetype_primary = 'audio';
|
1053 |
$mimetype_secondary = $fileext;
|
1054 |
-
} elseif (in_array($fileext, array_merge($video1types, $video2types))) {
|
1055 |
DebugEcho("GetContent: found video extension");
|
1056 |
$mimetype_primary = 'video';
|
1057 |
$mimetype_secondary = $fileext;
|
@@ -1066,7 +1066,7 @@ function GetContent($part, &$attachments, $post_id, $poster, $config) {
|
|
1066 |
case 'multipart':
|
1067 |
DebugEcho("GetContent: multipart: " . count($part->parts));
|
1068 |
//DebugDump($part);
|
1069 |
-
filter_PreferedText($part, $prefer_text_type);
|
1070 |
foreach ($part->parts as $section) {
|
1071 |
//DebugDump($section->headers);
|
1072 |
$meta_return .= GetContent($section, $attachments, $post_id, $poster, $config);
|
@@ -1091,7 +1091,7 @@ function GetContent($part, &$attachments, $post_id, $poster, $config) {
|
|
1091 |
|
1092 |
if ($charset !== '' || $encoding !== '') {
|
1093 |
//DebugDump($part);
|
1094 |
-
$part->body = HandleMessageEncoding($encoding, $charset, $part->body, $message_encoding, $message_dequote);
|
1095 |
if (!empty($charset)) {
|
1096 |
$part->ctype_parameters['charset'] = ""; //reset so we don't double decode
|
1097 |
}
|
@@ -1100,10 +1100,10 @@ function GetContent($part, &$attachments, $post_id, $poster, $config) {
|
|
1100 |
if (array_key_exists('disposition', $part) && $part->disposition == 'attachment') {
|
1101 |
DebugEcho("GetContent: text Attachement: $filename");
|
1102 |
if (!preg_match('/ATT\d\d\d\d\d.txt/i', $filename)) {
|
1103 |
-
$file_id = postie_media_handle_upload($part, $post_id, $poster, $generate_thumbnails);
|
1104 |
if (!is_wp_error($file_id)) {
|
1105 |
$file = wp_get_attachment_url($file_id);
|
1106 |
-
$icon = chooseAttachmentIcon($file, $mimetype_primary, $mimetype_secondary, $icon_set, $icon_size);
|
1107 |
$attachments["html"][$filename] = "<a href='$file'>" . $icon . $filename . '</a>' . "\n";
|
1108 |
DebugEcho("GetContent: text attachment: adding '$filename'");
|
1109 |
} else {
|
@@ -1128,7 +1128,7 @@ function GetContent($part, &$attachments, $post_id, $poster, $config) {
|
|
1128 |
//DebugDump($part);
|
1129 |
|
1130 |
DebugEcho("GetContent: body text");
|
1131 |
-
if ($allow_html_in_body) {
|
1132 |
DebugEcho("GetContent: html allowed");
|
1133 |
$meta_return .= $part->body;
|
1134 |
//$meta_return = "<div>$meta_return</div>\n";
|
@@ -1143,7 +1143,7 @@ function GetContent($part, &$attachments, $post_id, $poster, $config) {
|
|
1143 |
$file_id = postie_media_handle_upload($part, $post_id, $poster);
|
1144 |
if (!is_wp_error($file_id)) {
|
1145 |
$file = wp_get_attachment_url($file_id);
|
1146 |
-
$icon = chooseAttachmentIcon($file, $mimetype_primary, $mimetype_secondary, $icon_set, $icon_size);
|
1147 |
$attachments["html"][$filename] = "<a href='$file'>" . $icon . $filename . '</a>' . "\n";
|
1148 |
} else {
|
1149 |
LogInfo($file_id->get_error_message());
|
@@ -1154,29 +1154,29 @@ function GetContent($part, &$attachments, $post_id, $poster, $config) {
|
|
1154 |
|
1155 |
case 'image':
|
1156 |
DebugEcho("GetContent: image Attachement: $filename");
|
1157 |
-
$file_id = postie_media_handle_upload($part, $post_id, $poster, $generate_thumbnails, $mimetype_primary, $mimetype_secondary);
|
1158 |
if (!is_wp_error($file_id)) {
|
1159 |
//featured image logic
|
1160 |
//set the first image we come across as the featured image
|
1161 |
DebugEcho("GetContent: has_post_thumbnail: " . boolval(has_post_thumbnail($post_id)));
|
1162 |
//DebugEcho("get_the_post_thumbnail: " .get_the_post_thumbnail($post_id));
|
1163 |
|
1164 |
-
if ($featured_image && !has_post_thumbnail($post_id)) {
|
1165 |
DebugEcho("GetContent: featured image: $file_id");
|
1166 |
set_post_thumbnail($post_id, $file_id);
|
1167 |
-
}
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
}
|
1174 |
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
|
|
1180 |
}
|
1181 |
} else {
|
1182 |
LogInfo("image error: " . $file_id->get_error_message());
|
@@ -1186,7 +1186,7 @@ function GetContent($part, &$attachments, $post_id, $poster, $config) {
|
|
1186 |
case 'audio':
|
1187 |
//DebugDump($part->headers);
|
1188 |
DebugEcho("GetContent: audio Attachement: $filename");
|
1189 |
-
$file_id = postie_media_handle_upload($part, $post_id, $poster, $generate_thumbnails);
|
1190 |
if (!is_wp_error($file_id)) {
|
1191 |
$file = wp_get_attachment_url($file_id);
|
1192 |
$cid = "";
|
@@ -1194,12 +1194,12 @@ function GetContent($part, &$attachments, $post_id, $poster, $config) {
|
|
1194 |
$cid = trim($part->headers["content-id"], "<>");
|
1195 |
DebugEcho("GetContent: audio Attachement cid: $cid");
|
1196 |
}
|
1197 |
-
if (in_array($fileext, $audiotypes)) {
|
1198 |
DebugEcho("GetContent: using audio template: $mimetype_secondary");
|
1199 |
-
$audioTemplate = $audiotemplate;
|
1200 |
} else {
|
1201 |
DebugEcho("GetContent: using default audio template: $mimetype_secondary");
|
1202 |
-
$icon = chooseAttachmentIcon($file, $mimetype_primary, $mimetype_secondary, $icon_set, $icon_size);
|
1203 |
$audioTemplate = '<a href="{FILELINK}">' . $icon . '{FILENAME}</a>';
|
1204 |
}
|
1205 |
$attachments["html"][$filename] = parseTemplate($file_id, $mimetype_primary, $audioTemplate, $filename);
|
@@ -1210,7 +1210,7 @@ function GetContent($part, &$attachments, $post_id, $poster, $config) {
|
|
1210 |
|
1211 |
case 'video':
|
1212 |
DebugEcho("GetContent: video Attachement: $filename");
|
1213 |
-
$file_id = postie_media_handle_upload($part, $post_id, $poster, $generate_thumbnails);
|
1214 |
if (!is_wp_error($file_id)) {
|
1215 |
$file = wp_get_attachment_url($file_id);
|
1216 |
$cid = "";
|
@@ -1219,15 +1219,15 @@ function GetContent($part, &$attachments, $post_id, $poster, $config) {
|
|
1219 |
DebugEcho("GetContent: video Attachement cid: $cid");
|
1220 |
}
|
1221 |
//DebugDump($part);
|
1222 |
-
if (in_array($fileext, $video1types)) {
|
1223 |
DebugEcho("GetContent: using video1 template: $fileext");
|
1224 |
-
$videoTemplate = $video1template;
|
1225 |
-
} elseif (in_array($fileext, $video2types)) {
|
1226 |
DebugEcho("GetContent: using video2 template: $fileext");
|
1227 |
-
$videoTemplate = $video2template;
|
1228 |
} else {
|
1229 |
DebugEcho("GetContent: using default template: $fileext");
|
1230 |
-
$icon = chooseAttachmentIcon($file, $mimetype_primary, $mimetype_secondary, $icon_set, $icon_size);
|
1231 |
$videoTemplate = '<a href="{FILELINK}">' . $icon . '{FILENAME}</a>';
|
1232 |
}
|
1233 |
$attachments["html"][$filename] = parseTemplate($file_id, $mimetype_primary, $videoTemplate, $filename);
|
@@ -1239,19 +1239,19 @@ function GetContent($part, &$attachments, $post_id, $poster, $config) {
|
|
1239 |
|
1240 |
default:
|
1241 |
DebugEcho("GetContent: found file type: " . $mimetype_primary);
|
1242 |
-
if (in_array($mimetype_primary, $supported_file_types)) {
|
1243 |
//pgp signature - then forget it
|
1244 |
if ($mimetype_secondary == 'pgp-signature') {
|
1245 |
DebugEcho("GetContent: found pgp-signature - done");
|
1246 |
break;
|
1247 |
}
|
1248 |
-
$file_id = postie_media_handle_upload($part, $post_id, $poster, $generate_thumbnails);
|
1249 |
if (!is_wp_error($file_id)) {
|
1250 |
$file = wp_get_attachment_url($file_id);
|
1251 |
DebugEcho("GetContent: uploaded $file_id ($file)");
|
1252 |
-
$icon = chooseAttachmentIcon($file, $mimetype_primary, $mimetype_secondary, $icon_set, $icon_size);
|
1253 |
DebugEcho("GetContent: default: $icon $filename");
|
1254 |
-
$attachments["html"][$filename] = parseTemplate($file_id, $mimetype_primary, $generaltemplate, $filename, $icon);
|
1255 |
if (array_key_exists('content-id', $part->headers)) {
|
1256 |
$cid = trim($part->headers["content-id"], "<>");
|
1257 |
if ($cid) {
|
@@ -1265,7 +1265,7 @@ function GetContent($part, &$attachments, $post_id, $poster, $config) {
|
|
1265 |
}
|
1266 |
} else {
|
1267 |
DebugEcho("GetContent: Not in supported filetype list");
|
1268 |
-
DebugDump($supported_file_types);
|
1269 |
}
|
1270 |
break;
|
1271 |
}
|
1 |
<?php
|
2 |
/*
|
3 |
+
$Id: postie-functions.php 1214334 2015-08-06 19:00:48Z WayneAllen $
|
4 |
*/
|
5 |
|
6 |
//to turn on debug output add the following line to wp-config.php
|
988 |
|
989 |
//look for banned file names
|
990 |
if (property_exists($part, 'ctype_parameters') && is_array($part->ctype_parameters) && array_key_exists('name', $part->ctype_parameters)) {
|
991 |
+
if (isBannedFileName($part->ctype_parameters['name'], $config['banned_files_list'])) {
|
992 |
DebugEcho("GetContent: found banned filename");
|
993 |
return NULL;
|
994 |
}
|
1000 |
} else {
|
1001 |
DebugEcho("GetContent: decoding application/octet-stream");
|
1002 |
$mimeDecodedEmail = DecodeMIMEMail($part->body);
|
1003 |
+
filter_PreferedText($mimeDecodedEmail, $config['prefer_text_type']);
|
1004 |
foreach ($mimeDecodedEmail->parts as $section) {
|
1005 |
$meta_return .= GetContent($section, $attachments, $post_id, $poster, $config);
|
1006 |
}
|
1010 |
if (property_exists($part, "ctype_primary") && $part->ctype_primary == "multipart" && $part->ctype_secondary == "appledouble") {
|
1011 |
DebugEcho("GetContent: multipart appledouble");
|
1012 |
$mimeDecodedEmail = DecodeMIMEMail("Content-Type: multipart/mixed; boundary=" . $part->ctype_parameters["boundary"] . "\n" . $part->body);
|
1013 |
+
filter_PreferedText($mimeDecodedEmail, $config['prefer_text_type']);
|
1014 |
filter_AppleFile($mimeDecodedEmail);
|
1015 |
foreach ($mimeDecodedEmail->parts as $section) {
|
1016 |
$meta_return .= GetContent($section, $attachments, $post_id, $poster, $config);
|
1047 |
$mimetype_secondary = $mimeparts[1];
|
1048 |
} else {
|
1049 |
DebugEcho("GetContent: secondary lookup failed, checking configured extensions");
|
1050 |
+
if (in_array($fileext, $config['audiotypes'])) {
|
1051 |
DebugEcho("GetContent: found audio extension");
|
1052 |
$mimetype_primary = 'audio';
|
1053 |
$mimetype_secondary = $fileext;
|
1054 |
+
} elseif (in_array($fileext, array_merge($config['video1types'], $config['video2types']))) {
|
1055 |
DebugEcho("GetContent: found video extension");
|
1056 |
$mimetype_primary = 'video';
|
1057 |
$mimetype_secondary = $fileext;
|
1066 |
case 'multipart':
|
1067 |
DebugEcho("GetContent: multipart: " . count($part->parts));
|
1068 |
//DebugDump($part);
|
1069 |
+
filter_PreferedText($part, $config['prefer_text_type']);
|
1070 |
foreach ($part->parts as $section) {
|
1071 |
//DebugDump($section->headers);
|
1072 |
$meta_return .= GetContent($section, $attachments, $post_id, $poster, $config);
|
1091 |
|
1092 |
if ($charset !== '' || $encoding !== '') {
|
1093 |
//DebugDump($part);
|
1094 |
+
$part->body = HandleMessageEncoding($encoding, $charset, $part->body, $config['message_encoding'], $config['message_dequote']);
|
1095 |
if (!empty($charset)) {
|
1096 |
$part->ctype_parameters['charset'] = ""; //reset so we don't double decode
|
1097 |
}
|
1100 |
if (array_key_exists('disposition', $part) && $part->disposition == 'attachment') {
|
1101 |
DebugEcho("GetContent: text Attachement: $filename");
|
1102 |
if (!preg_match('/ATT\d\d\d\d\d.txt/i', $filename)) {
|
1103 |
+
$file_id = postie_media_handle_upload($part, $post_id, $poster, $config['generate_thumbnails']);
|
1104 |
if (!is_wp_error($file_id)) {
|
1105 |
$file = wp_get_attachment_url($file_id);
|
1106 |
+
$icon = chooseAttachmentIcon($file, $mimetype_primary, $mimetype_secondary, $config['icon_set'], $config['icon_size']);
|
1107 |
$attachments["html"][$filename] = "<a href='$file'>" . $icon . $filename . '</a>' . "\n";
|
1108 |
DebugEcho("GetContent: text attachment: adding '$filename'");
|
1109 |
} else {
|
1128 |
//DebugDump($part);
|
1129 |
|
1130 |
DebugEcho("GetContent: body text");
|
1131 |
+
if ($config['allow_html_in_body']) {
|
1132 |
DebugEcho("GetContent: html allowed");
|
1133 |
$meta_return .= $part->body;
|
1134 |
//$meta_return = "<div>$meta_return</div>\n";
|
1143 |
$file_id = postie_media_handle_upload($part, $post_id, $poster);
|
1144 |
if (!is_wp_error($file_id)) {
|
1145 |
$file = wp_get_attachment_url($file_id);
|
1146 |
+
$icon = chooseAttachmentIcon($file, $mimetype_primary, $mimetype_secondary, $config['icon_set'], $config['icon_size']);
|
1147 |
$attachments["html"][$filename] = "<a href='$file'>" . $icon . $filename . '</a>' . "\n";
|
1148 |
} else {
|
1149 |
LogInfo($file_id->get_error_message());
|
1154 |
|
1155 |
case 'image':
|
1156 |
DebugEcho("GetContent: image Attachement: $filename");
|
1157 |
+
$file_id = postie_media_handle_upload($part, $post_id, $poster, $config['generate_thumbnails'], $mimetype_primary, $mimetype_secondary);
|
1158 |
if (!is_wp_error($file_id)) {
|
1159 |
//featured image logic
|
1160 |
//set the first image we come across as the featured image
|
1161 |
DebugEcho("GetContent: has_post_thumbnail: " . boolval(has_post_thumbnail($post_id)));
|
1162 |
//DebugEcho("get_the_post_thumbnail: " .get_the_post_thumbnail($post_id));
|
1163 |
|
1164 |
+
if ($config['featured_image'] && !has_post_thumbnail($post_id)) {
|
1165 |
DebugEcho("GetContent: featured image: $file_id");
|
1166 |
set_post_thumbnail($post_id, $file_id);
|
1167 |
+
} else {
|
1168 |
+
$cid = "";
|
1169 |
+
if (array_key_exists('content-id', $part->headers)) {
|
1170 |
+
$cid = trim($part->headers["content-id"], "<>");
|
1171 |
+
DebugEcho("GetContent: found cid: $cid");
|
1172 |
+
}
|
|
|
1173 |
|
1174 |
+
$attachments["html"][$filename] = parseTemplate($file_id, $mimetype_primary, $config['imagetemplate'], $filename);
|
1175 |
+
if (!empty($cid)) {
|
1176 |
+
$file = wp_get_attachment_url($file_id);
|
1177 |
+
$attachments["cids"][$cid] = array($file, count($attachments["html"]) - 1);
|
1178 |
+
DebugEcho("GetContent: CID Attachement: $cid");
|
1179 |
+
}
|
1180 |
}
|
1181 |
} else {
|
1182 |
LogInfo("image error: " . $file_id->get_error_message());
|
1186 |
case 'audio':
|
1187 |
//DebugDump($part->headers);
|
1188 |
DebugEcho("GetContent: audio Attachement: $filename");
|
1189 |
+
$file_id = postie_media_handle_upload($part, $post_id, $poster, $config['generate_thumbnails']);
|
1190 |
if (!is_wp_error($file_id)) {
|
1191 |
$file = wp_get_attachment_url($file_id);
|
1192 |
$cid = "";
|
1194 |
$cid = trim($part->headers["content-id"], "<>");
|
1195 |
DebugEcho("GetContent: audio Attachement cid: $cid");
|
1196 |
}
|
1197 |
+
if (in_array($fileext, $config['audiotypes'])) {
|
1198 |
DebugEcho("GetContent: using audio template: $mimetype_secondary");
|
1199 |
+
$audioTemplate = $config['audiotemplate'];
|
1200 |
} else {
|
1201 |
DebugEcho("GetContent: using default audio template: $mimetype_secondary");
|
1202 |
+
$icon = chooseAttachmentIcon($file, $mimetype_primary, $mimetype_secondary, $config['icon_set'], $config['icon_size']);
|
1203 |
$audioTemplate = '<a href="{FILELINK}">' . $icon . '{FILENAME}</a>';
|
1204 |
}
|
1205 |
$attachments["html"][$filename] = parseTemplate($file_id, $mimetype_primary, $audioTemplate, $filename);
|
1210 |
|
1211 |
case 'video':
|
1212 |
DebugEcho("GetContent: video Attachement: $filename");
|
1213 |
+
$file_id = postie_media_handle_upload($part, $post_id, $poster, $config['generate_thumbnails']);
|
1214 |
if (!is_wp_error($file_id)) {
|
1215 |
$file = wp_get_attachment_url($file_id);
|
1216 |
$cid = "";
|
1219 |
DebugEcho("GetContent: video Attachement cid: $cid");
|
1220 |
}
|
1221 |
//DebugDump($part);
|
1222 |
+
if (in_array($fileext, $config['video1types'])) {
|
1223 |
DebugEcho("GetContent: using video1 template: $fileext");
|
1224 |
+
$videoTemplate = $config['video1template'];
|
1225 |
+
} elseif (in_array($fileext, $config['video2types'])) {
|
1226 |
DebugEcho("GetContent: using video2 template: $fileext");
|
1227 |
+
$videoTemplate = $config['video2template'];
|
1228 |
} else {
|
1229 |
DebugEcho("GetContent: using default template: $fileext");
|
1230 |
+
$icon = chooseAttachmentIcon($file, $mimetype_primary, $mimetype_secondary, $config['icon_set'], $config['icon_size']);
|
1231 |
$videoTemplate = '<a href="{FILELINK}">' . $icon . '{FILENAME}</a>';
|
1232 |
}
|
1233 |
$attachments["html"][$filename] = parseTemplate($file_id, $mimetype_primary, $videoTemplate, $filename);
|
1239 |
|
1240 |
default:
|
1241 |
DebugEcho("GetContent: found file type: " . $mimetype_primary);
|
1242 |
+
if (in_array($mimetype_primary, $config['supported_file_types'])) {
|
1243 |
//pgp signature - then forget it
|
1244 |
if ($mimetype_secondary == 'pgp-signature') {
|
1245 |
DebugEcho("GetContent: found pgp-signature - done");
|
1246 |
break;
|
1247 |
}
|
1248 |
+
$file_id = postie_media_handle_upload($part, $post_id, $poster, $config['generate_thumbnails']);
|
1249 |
if (!is_wp_error($file_id)) {
|
1250 |
$file = wp_get_attachment_url($file_id);
|
1251 |
DebugEcho("GetContent: uploaded $file_id ($file)");
|
1252 |
+
$icon = chooseAttachmentIcon($file, $mimetype_primary, $mimetype_secondary, $config['icon_set'], $config['icon_size']);
|
1253 |
DebugEcho("GetContent: default: $icon $filename");
|
1254 |
+
$attachments["html"][$filename] = parseTemplate($file_id, $mimetype_primary, $config['generaltemplate'], $filename, $icon);
|
1255 |
if (array_key_exists('content-id', $part->headers)) {
|
1256 |
$cid = trim($part->headers["content-id"], "<>");
|
1257 |
if ($cid) {
|
1265 |
}
|
1266 |
} else {
|
1267 |
DebugEcho("GetContent: Not in supported filetype list");
|
1268 |
+
DebugDump($config['supported_file_types']);
|
1269 |
}
|
1270 |
break;
|
1271 |
}
|
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.7.
|
8 |
Author: Wayne Allen
|
9 |
Author URI: http://PostiePlugin.com/
|
10 |
License: GPL2
|
@@ -27,11 +27,11 @@
|
|
27 |
*/
|
28 |
|
29 |
/*
|
30 |
-
$Id: postie.php
|
31 |
*/
|
32 |
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
|
33 |
|
34 |
-
define('POSTIE_VERSION', '1.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.7.5
|
8 |
Author: Wayne Allen
|
9 |
Author URI: http://PostiePlugin.com/
|
10 |
License: GPL2
|
27 |
*/
|
28 |
|
29 |
/*
|
30 |
+
$Id: postie.php 1214334 2015-08-06 19:00:48Z WayneAllen $
|
31 |
*/
|
32 |
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
|
33 |
|
34 |
+
define('POSTIE_VERSION', '1.7.5');
|
35 |
define("POSTIE_ROOT", dirname(__FILE__));
|
36 |
define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
|
37 |
|
readme.txt
CHANGED
@@ -5,8 +5,8 @@ Author URI: http://allens-home.com/
|
|
5 |
Plugin URI: http://PostiePlugin.com/
|
6 |
Tags: e-mail, email, post-by-email
|
7 |
Requires at least: 3.3.0
|
8 |
-
Tested up to: 4.2.
|
9 |
-
Stable tag: 1.7.
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
@@ -234,6 +234,9 @@ All script, style and body tags are stripped from html emails.
|
|
234 |
Attachments are now processed in the order they were attached.
|
235 |
|
236 |
== CHANGELOG ==
|
|
|
|
|
|
|
237 |
= 1.7.4 (2015-07-30) =
|
238 |
* Added additional output if wp_insert_post() fails
|
239 |
* Fixed image upload failure when image filename doesn't have an extension
|
5 |
Plugin URI: http://PostiePlugin.com/
|
6 |
Tags: e-mail, email, post-by-email
|
7 |
Requires at least: 3.3.0
|
8 |
+
Tested up to: 4.2.4
|
9 |
+
Stable tag: 1.7.5
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
234 |
Attachments are now processed in the order they were attached.
|
235 |
|
236 |
== CHANGELOG ==
|
237 |
+
= 1.7.5 (2015-08-06) =
|
238 |
+
* If featured image is enabled, the featured image will no longer appear in the post.
|
239 |
+
|
240 |
= 1.7.4 (2015-07-30) =
|
241 |
* Added additional output if wp_insert_post() fails
|
242 |
* Fixed image upload failure when image filename doesn't have an extension
|