WordPress.org

Make WordPress Core

Ticket #21679: 21679.patch

File 21679.patch, 564 bytes (added by SergeyBiryukov, 9 years ago)
  • wp-admin/includes/media.php

     
    209209                        $time = $post->post_date;
    210210        }
    211211
    212         $name = $_FILES[$file_id]['name'];
    213         $file = wp_handle_upload($_FILES[$file_id], $overrides, $time);
     212        $file = wp_handle_upload( $_FILES[ $file_id ], $overrides, $time );
     213        $name = wp_basename( $file['file'] );
    214214
    215215        if ( isset($file['error']) )
    216216                return new WP_Error( 'upload_error', $file['error'] );