X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/96bc8e88cf39086a9e0a883b8e2c311fe82a5e97..4713a14935b83517997f3c88f808eb41da55033d:/wp-admin/media.php?ds=sidebyside diff --git a/wp-admin/media.php b/wp-admin/media.php index 1b750d58..7920bef9 100644 --- a/wp-admin/media.php +++ b/wp-admin/media.php @@ -7,7 +7,7 @@ */ /** Load WordPress Administration Bootstrap */ -require_once('./admin.php'); +require_once( dirname( __FILE__ ) . '/admin.php' ); $parent_file = 'upload.php'; $submenu_file = 'upload.php'; @@ -59,6 +59,7 @@ case 'edit' : $att = get_post($att_id); if ( empty($att->ID) ) wp_die( __('You attempted to edit an attachment that doesn’t exist. Perhaps it was deleted?') ); + if ( 'attachment' !== $att->post_type ) wp_die( __('You attempted to edit an item that isn’t an attachment. Please go back and try again.') ); if ( $att->post_status == 'trash' ) wp_die( __('You can’t edit this attachment because it is in the Trash. Please move it out of the Trash and try again.') ); add_filter('attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2); @@ -80,10 +81,10 @@ case 'edit' : get_current_screen()->set_help_sidebar( '

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

' . '

' . __('Documentation on Edit Media') . '

' . - '

' . __('Support Forums') . '

' + '

' . __('Support Forums') . '

' ); - require( './admin-header.php' ); + require( ABSPATH . 'wp-admin/admin-header.php' ); $parent_file = 'upload.php'; $message = ''; @@ -102,7 +103,6 @@ case 'edit' : ?>
-