Index: press-this.php
===================================================================
--- press-this.php (revision 8166)
+++ press-this.php (working copy)
@@ -30,7 +30,7 @@
# see if files exist in content - we don't want to upload non-used selected files.
preg_match('/'.$quoted.'/', $_REQUEST['content'], $matches[0]);
if($matches[0])
- media_sideload_image($data, $post_ID, $_REQUEST['photo_description'][$key]);
+ $upload = media_sideload_image($data, $post_ID, $_REQUEST['photo_description'][$key]);
}
$content = $_REQUEST['content'];
break;
@@ -45,11 +45,13 @@
$quick['post_content'] = str_replace('
', "\n", preg_replace('/<\/?p>/','',$content));
#error handling for $post
- if ( is_wp_error($post_ID) ) {
+ if ( is_wp_error($post_ID)) {
wp_die($id);
wp_delete_post($post_ID);
-
#error handling for media_sideload
+ } elseif ( is_wp_error($upload)) {
+ wp_die($upload);
+ wp_delete_post($post_ID);
} else {
$quick['ID'] = $post_ID;
wp_update_post($quick);
@@ -78,6 +80,7 @@
?>
| | Close Window