WordPress.org

Make WordPress Core

Ticket #4737: checkid.patch

File checkid.patch, 1.0 KB (added by Viper007Bond, 8 years ago)
  • wp-admin/page.php

     
    4545        $page_ID = $post_ID = $p = (int) $_GET['post']; 
    4646        $post = get_post_to_edit($page_ID); 
    4747 
     48        if ( empty($post->ID) ) wp_die( __("You attempted to edit a page with an ID that doesn't exist in the database. Perhaps it was deleted?") ); 
     49 
    4850        if ( 'post' == $post->post_type ) { 
    4951                wp_redirect("post.php?action=edit&post=$post_ID"); 
    5052                exit(); 
  • wp-admin/post.php

     
    4848        $post_ID = $p = (int) $_GET['post']; 
    4949        $post = get_post($post_ID); 
    5050 
     51        if ( empty($post->ID) ) wp_die( __("You attempted to edit a post with an ID that doesn't exist in the database. Perhaps it was deleted?") ); 
     52 
    5153        if ( 'page' == $post->post_type ) { 
    5254                wp_redirect("page.php?action=edit&post=$post_ID"); 
    5355                exit();