Set empty file type if skipping file type check. Fixes notices when importing. See #9393 props sivel.

git-svn-id: http://svn.automattic.com/wordpress/trunk@11227 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2009-05-07 06:50:54 +00:00
parent bec3e497e5
commit 51ff5245cf
1 changed files with 3 additions and 3 deletions

View File

@ -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 ) );
}
/**