X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/959f97d8ecd5c1668103a3e41c795486b944bc68..9c40b4d36daed9e28e48a5fe9205c32557195a4b:/wp-admin/page.php?ds=inline diff --git a/wp-admin/page.php b/wp-admin/page.php index b10fa727..68a66902 100644 --- a/wp-admin/page.php +++ b/wp-admin/page.php @@ -1,12 +1,29 @@ ID) ) wp_die( __("You attempted to edit a page that doesn't exist. Perhaps it was deleted?") ); + if ( empty($post->ID) ) wp_die( __('You attempted to edit a page that doesn’t exist. Perhaps it was deleted?') ); - if ( 'post' == $post->post_type ) { - wp_redirect("post.php?action=edit&post=$post_ID"); + if ( 'page' != $post->post_type ) { + wp_redirect( get_edit_post_link( $post_ID, 'url' ) ); exit(); } wp_enqueue_script('page'); if ( user_can_richedit() ) wp_enqueue_script('editor'); - wp_enqueue_script('thickbox'); + add_thickbox(); wp_enqueue_script('media-upload'); + wp_enqueue_script('word-count'); if ( current_user_can('edit_page', $page_ID) ) { if ( $last = wp_check_post_lock( $post->ID ) ) { $last_user = get_userdata( $last ); $last_user_name = $last_user ? $last_user->display_name : __('Somebody'); - $message = sprintf( __( 'Warning: %s is currently editing this page' ), wp_specialchars( $last_user_name ) ); + $message = sprintf( __( 'Warning: %s is currently editing this page' ), esc_html( $last_user_name ) ); $message = str_replace( "'", "\'", "
$message