From bc036d08435fbe2a91fcc437ff837d717c248fa7 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 27 Feb 2014 21:16:15 +0000 Subject: [PATCH] Avoid an undefined index notice in wp_handle_upload(). props tivnet. fixes #27225. Built from https://develop.svn.wordpress.org/trunk@27319 git-svn-id: http://core.svn.wordpress.org/trunk@27171 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/file.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index 5cb0f49211..4033a30cd7 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -258,8 +258,9 @@ function wp_handle_upload( &$file, $overrides = false, $time = null ) { return call_user_func($upload_error_handler, $file, __( 'Invalid form submission.' )); // A successful upload will pass this test. It makes no sense to override this one. - if ( $file['error'] > 0 ) - return call_user_func($upload_error_handler, $file, $upload_error_strings[$file['error']] ); + if ( isset( $file['error'] ) && $file['error'] > 0 ) { + return call_user_func( $upload_error_handler, $file, $upload_error_strings[ $file['error'] ] ); + } // A non-empty file will pass this test. if ( $test_size && !($file['size'] > 0 ) ) {