Make WordPress Core


Ignore:
Timestamp:
12/13/2018 01:29:42 AM (6 years ago)
Author:
peterwilsoncc
Message:

Multisite: Validate activation links.

Merges [44048] to the 5.0 branch.

Location:
branches/5.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0

  • branches/5.0/src/wp-admin/post.php

    r44047 r44050  
    1717wp_reset_vars( array( 'action' ) );
    1818
    19 if ( isset( $_GET['post'] ) )
     19if ( isset( $_GET['post'] ) && isset( $_POST['post_ID'] ) && (int) $_GET['post'] !== (int) $_POST['post_ID'] )
     20    wp_die( __( 'A post ID mismatch has been detected.' ), __( 'Sorry, you are not allowed to edit this item.' ), 400 );
     21elseif ( isset( $_GET['post'] ) )
    2022    $post_id = $post_ID = (int) $_GET['post'];
    2123elseif ( isset( $_POST['post_ID'] ) )
     
    3739    $post_type = $post->post_type;
    3840    $post_type_object = get_post_type_object( $post_type );
     41}
     42
     43if ( isset( $_POST['post_type'] ) && $post && $post_type !== $_POST['post_type'] ) {
     44    wp_die( __( 'A post type mismatch has been detected.' ), __( 'Sorry, you are not allowed to edit this item.' ), 400 );
    3945}
    4046
Note: See TracChangeset for help on using the changeset viewer.