X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/7f1521bf193b382565eb753043c161f4cb3fcda7..607b7e02d77e7326161e8ec15639052d2040f745:/wp-admin/media-new.php diff --git a/wp-admin/media-new.php b/wp-admin/media-new.php index f68a4eef..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; } @@ -65,7 +65,7 @@ if ( get_user_setting('uploader') || isset( $_GET['browser-uploader'] ) ) $form_class .= ' html-uploader'; ?>
-

+