From 50b1400ee522988fd8ecde8e392743fe14289347 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 21 Dec 2007 01:40:26 +0000 Subject: [PATCH] Check attachment link when deleting. git-svn-id: https://develop.svn.wordpress.org/trunk@6446 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-app.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wp-app.php b/wp-app.php index 2791ee7263..e8f0997697 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);