From e6080b4926c2858e06cacf241ec611c74f357bea Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 21 Dec 2007 01:40:26 +0000 Subject: [PATCH] Check attachment link when deleting. git-svn-id: http://svn.automattic.com/wordpress/trunk@6446 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-app.php | 4 ++++ 1 file changed, 4 insertions(+) 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);