Make WordPress Core


Ignore:
Timestamp:
12/13/2018 01:50:03 AM (7 years ago)
Author:
pento
Message:

Editor: Remove unwanted fields before saving posts.

The meta_input, file, and guid fields are not intended to be updated through user input.

Merges [44047] to the 4.3 branch.

Location:
branches/4.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.3

  • branches/4.3/src/wp-admin/includes/ajax-actions.php

    r37797 r44064  
    19181918    }
    19191919
    1920     $post_data = isset( $_REQUEST['post_data'] ) ? $_REQUEST['post_data'] : array();
     1920    $post_data = ! empty( $_REQUEST['post_data'] ) ? _wp_get_allowed_postdata( _wp_translate_postdata( false, (array) $_REQUEST['post_data'] ) ) : array();
     1921
     1922    if ( is_wp_error( $post_data ) ) {
     1923        wp_die( $post_data->get_error_message() );
     1924    }
    19211925
    19221926    // If the context is custom header or background, make sure the uploaded file is an image.
Note: See TracChangeset for help on using the changeset viewer.