WordPress.org

Make WordPress Core

Ticket #37570: 37570.3.diff

File 37570.3.diff, 987 bytes (added by ocean90, 5 years ago)
  • src/wp-admin/includes/file.php

     
    245245function _wp_handle_upload( &$file, $overrides, $time, $action ) {
    246246        // The default error handler.
    247247        if ( ! function_exists( 'wp_handle_upload_error' ) ) {
    248                 function wp_handle_upload_error( &$file, $message ) {
     248                function wp_handle_upload_error( $file, $message ) {
    249249                        return array( 'error' => $message );
    250250                }
    251251        }
     
    270270
    271271        // You may have had one or more 'wp_handle_upload_prefilter' functions error out the file. Handle that gracefully.
    272272        if ( isset( $file['error'] ) && ! is_numeric( $file['error'] ) && $file['error'] ) {
    273                 return $upload_error_handler( $file, $file['error'] );
     273                return call_user_func( $upload_error_handler, $file, $file['error'] );
    274274        }
    275275
    276276        // Install user overrides. Did we mention that this voids your warranty?