diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php index 5cb0f49211..4033a30cd7 100644 --- a/src/wp-admin/includes/file.php +++ b/src/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 ) ) {