From fa31602215749ed6772f1102a04f7dbb87e59be6 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Thu, 7 May 2009 06:50:54 +0000 Subject: [PATCH] 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 --- wp-admin/includes/file.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index df8a1e477f..da46d27f2a 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -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 ) ); } /**