@@ 273-275 (lines=3) @@ | ||
270 | } |
|
271 | ||
272 | // You may have had one or more 'wp_handle_upload_prefilter' functions error out the file. Handle that gracefully. |
|
273 | if ( isset( $file['error'] ) && ! is_numeric( $file['error'] ) && $file['error'] ) { |
|
274 | return call_user_func_array( $upload_error_handler, array( &$file, $file['error'] ) ); |
|
275 | } |
|
276 | ||
277 | // Install user overrides. Did we mention that this voids your warranty? |
|
278 | ||
@@ 315-317 (lines=3) @@ | ||
312 | $mimes = isset( $overrides['mimes'] ) ? $overrides['mimes'] : false; |
|
313 | ||
314 | // A correct form post will pass this test. |
|
315 | if ( $test_form && ( ! isset( $_POST['action'] ) || ( $_POST['action'] != $action ) ) ) { |
|
316 | return call_user_func_array( $upload_error_handler, array( &$file, __( 'Invalid form submission.' ) ) ); |
|
317 | } |
|
318 | // A successful upload will pass this test. It makes no sense to override this one. |
|
319 | if ( isset( $file['error'] ) && $file['error'] > 0 ) { |
|
320 | return call_user_func_array( $upload_error_handler, array( &$file, $upload_error_strings[ $file['error'] ] ) ); |
|
@@ 319-321 (lines=3) @@ | ||
316 | return call_user_func_array( $upload_error_handler, array( &$file, __( 'Invalid form submission.' ) ) ); |
|
317 | } |
|
318 | // A successful upload will pass this test. It makes no sense to override this one. |
|
319 | if ( isset( $file['error'] ) && $file['error'] > 0 ) { |
|
320 | return call_user_func_array( $upload_error_handler, array( &$file, $upload_error_strings[ $file['error'] ] ) ); |
|
321 | } |
|
322 | ||
323 | $test_file_size = 'wp_handle_upload' === $action ? $file['size'] : filesize( $file['tmp_name'] ); |
|
324 | // A non-empty file will pass this test. |