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:
parent
bec3e497e5
commit
51ff5245cf
|
@ -283,6 +283,8 @@ function wp_handle_upload( &$file, $overrides = false, $time = null ) {
|
||||||
|
|
||||||
if ( !$type )
|
if ( !$type )
|
||||||
$type = $file['type'];
|
$type = $file['type'];
|
||||||
|
} else {
|
||||||
|
$type = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// A writable uploads dir will pass this test. Again, there's no point overriding this one.
|
// 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
|
// Compute the URL
|
||||||
$url = $uploads['url'] . "/$filename";
|
$url = $uploads['url'] . "/$filename";
|
||||||
|
|
||||||
$return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) );
|
return apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) );
|
||||||
|
|
||||||
return $return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue