mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-16 19:46:21 +00:00
Check attachment link when deleting.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0106156df2
commit
e6080b4926
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user