WordPress.org

Make WordPress Core

Ticket #16820: 16820.2.diff

File 16820.2.diff, 632 bytes (added by solarissmoke, 5 years ago)
  • wp-admin/media-new.php

     
    2525}
    2626
    2727if ( $_POST ) {
    28         $location = 'upload.php';
    2928        if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
    3029                check_admin_referer('media-form');
    3130                // Upload File button was clicked
    3231                $id = media_handle_upload( 'async-upload', $post_id );
    3332                if ( is_wp_error( $id ) )
    34                         $location .= '?message=3';
     33                        wp_die( $id );
    3534        }
    36         wp_redirect( admin_url( $location ) );
     35        wp_redirect( admin_url( 'upload.php' ) );
    3736        exit;
    3837}
    3938