diff --git a/wp-app.php b/wp-app.php index 2791ee726..e8f099769 100644 --- a/wp-app.php +++ b/wp-app.php @@ -485,6 +485,10 @@ EOD; } $location = get_post_meta($entry['ID'], '_wp_attached_file', true); + $filetype = wp_check_filetype($location); + + if(!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext'])) + $this->internal_error(__('Error ocurred while accessing post metadata for file location.')); // delete file @unlink($location);