Make WordPress Core


Ignore:
Timestamp:
11/02/2016 06:01:49 AM (9 years ago)
Author:
rmccue
Message:

REST API: Avoid default sanitization for polymorphic params.

Some parameters (title, content, etc) are objects in the output, but allow objects or strings to be sent in updates for a more ergonomic interface. This is pretty weird behaviour, so the default sanitisation doesn't handle this. We instead handle this ourselves in the preparation.

Props joehoyle, rachelbaker.
Fixes #38529.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php

    r39015 r39089  
    11331133                    'type'            => 'object',
    11341134                    'context'         => array( 'view', 'edit', 'embed' ),
     1135                    'arg_options'     => array(
     1136                        'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database()
     1137                    ),
    11351138                    'properties'      => array(
    11361139                        'raw'         => array(
Note: See TracChangeset for help on using the changeset viewer.