Set empty file type if skipping file type check. Fixes notices when importing. See #9393 props sivel.
git-svn-id: https://develop.svn.wordpress.org/trunk@11227 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
18291c1084
commit
fa31602215
@ -283,6 +283,8 @@ function wp_handle_upload( &$file, $overrides = false, $time = null ) {
|
||||
|
||||
if ( !$type )
|
||||
$type = $file['type'];
|
||||
} else {
|
||||
$type = '';
|
||||
}
|
||||
|
||||
// A writable uploads dir will pass this test. Again, there's no point overriding this one.
|
||||
@ -305,9 +307,7 @@ function wp_handle_upload( &$file, $overrides = false, $time = null ) {
|
||||
// Compute the URL
|
||||
$url = $uploads['url'] . "/$filename";
|
||||
|
||||
$return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) );
|
||||
|
||||
return $return;
|
||||
return apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user