Make WordPress Core


Ignore:
Timestamp:
12/13/2018 01:39:08 AM (8 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.8 branch.

Location:
branches/4.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.8

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

    r40790 r44055  
    20882088        }
    20892089
    2090         $post_data = isset( $_REQUEST['post_data'] ) ? $_REQUEST['post_data'] : array();
     2090        $post_data = ! empty( $_REQUEST['post_data'] ) ? _wp_get_allowed_postdata( _wp_translate_postdata( false, (array) $_REQUEST['post_data'] ) ) : array();
     2091
     2092        if ( is_wp_error( $post_data ) ) {
     2093                wp_die( $post_data->get_error_message() );
     2094        }
    20912095
    20922096        // 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.