mirror of
git://develop.git.wordpress.org/
synced 2025-01-19 13:47:02 +01:00
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:
parent
bc001a3088
commit
50b1400ee5
@ -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