X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/53f4633144ed68c8b8fb5861f992b5489894a940..febc815b2c9d85be5717da9e8d164bd2daa97e31:/wp-admin/media-new.php diff --git a/wp-admin/media-new.php b/wp-admin/media-new.php index c8263d8a..86d8810a 100644 --- a/wp-admin/media-new.php +++ b/wp-admin/media-new.php @@ -13,7 +13,7 @@ require_once( dirname( __FILE__ ) . '/admin.php' ); if (!current_user_can('upload_files')) - wp_die(__('You do not have permission to upload files.')); + wp_die(__('Sorry, you are not allowed to upload files.')); wp_enqueue_script('plupload-handlers'); @@ -25,15 +25,15 @@ if ( isset( $_REQUEST['post_id'] ) ) { } if ( $_POST ) { - $location = 'upload.php'; if ( isset($_POST['html-upload']) && !empty($_FILES) ) { check_admin_referer('media-form'); // Upload File button was clicked - $id = media_handle_upload( 'async-upload', $post_id ); - if ( is_wp_error( $id ) ) - $location .= '?message=3'; + $upload_id = media_handle_upload( 'async-upload', $post_id ); + if ( is_wp_error( $upload_id ) ) { + wp_die( $upload_id ); + } } - wp_redirect( admin_url( $location ) ); + wp_redirect( admin_url( 'upload.php' ) ); exit; }