Check attachment link when deleting.

git-svn-id: https://develop.svn.wordpress.org/trunk@6446 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2007-12-21 01:40:26 +00:00
parent bc001a3088
commit 50b1400ee5

View File

@ -485,6 +485,10 @@ EOD;
} }
$location = get_post_meta($entry['ID'], '_wp_attached_file', true); $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 // delete file
@unlink($location); @unlink($location);