Avoid an undefined index notice in wp_handle_upload().
props tivnet. fixes #27225. git-svn-id: https://develop.svn.wordpress.org/trunk@27319 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
2dd4f585aa
commit
a53fab8750
@ -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 ) ) {
|
||||
|
Loading…
Reference in New Issue
Block a user