Unlink temporary file if sideload fails. see #7220
git-svn-id: http://svn.automattic.com/wordpress/trunk@8241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
eb1f9d0b39
commit
3497e63495
|
@ -340,10 +340,8 @@ function media_sideload_image($file, $post_id, $desc = null) {
|
|||
$id = media_handle_sideload($file_array, $post_id, $desc);
|
||||
$src = $id;
|
||||
|
||||
unset($file_array);
|
||||
|
||||
if ( is_wp_error($id) ) {
|
||||
$errors['upload_error'] = $id;
|
||||
@unlink($file_array['tmp_name']);
|
||||
return $id;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue