X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/6c8f14c09105d0afa4c1574215c59b5021040e76..b925718b4bf2dd47a8429f844d0a255ca6e35bd1:/wp-admin/media-new.php diff --git a/wp-admin/media-new.php b/wp-admin/media-new.php index c6a7ae14..9d26651e 100644 --- a/wp-admin/media-new.php +++ b/wp-admin/media-new.php @@ -10,7 +10,7 @@ */ /** Load WordPress Administration Bootstrap */ -require_once('./admin.php'); +require_once( dirname( __FILE__ ) . '/admin.php' ); if (!current_user_can('upload_files')) wp_die(__('You do not have permission to upload files.')); @@ -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; } @@ -53,8 +53,8 @@ get_current_screen()->add_help_tab( array( ) ); get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . - '

' . __('Documentation on Uploading Media Files') . '

' . - '

' . __('Support Forums') . '

' + '

' . __('Documentation on Uploading Media Files') . '

' . + '

' . __('Support Forums') . '

' ); require_once( ABSPATH . 'wp-admin/admin-header.php' ); @@ -65,10 +65,9 @@ if ( get_user_setting('uploader') || isset( $_GET['browser-uploader'] ) ) $form_class .= ' html-uploader'; ?>
- -

+

-
+