Make WordPress Core

Changeset 47755


Ignore:
Timestamp:
05/03/2020 10:40:53 PM (6 years ago)
Author:
TimothyBlynJacobs
Message:

REST API: Validate that the oembed url parameter is a string.

This prevents a PHP warning from being issued by esc_url_raw when a non-string value is provided.

Props dd32.
Fixes #49991.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-oembed-controller.php

    r46696 r47755  
    4141                                        'args'     => array(
    4242                                                'url'      => array(
    43                                                         'required'          => true,
    44                                                         'sanitize_callback' => 'esc_url_raw',
     43                                                        'description' => __( 'The URL of the resource for which to fetch oEmbed data.' ),
     44                                                        'required'    => true,
     45                                                        'type'        => 'string',
     46                                                        'format'      => 'uri',
    4547                                                ),
    4648                                                'format'   => array(
    … …  
    6769                                        'args'                => array(
    6870                                                'url'       => array(
    69                                                         'description'       => __( 'The URL of the resource for which to fetch oEmbed data.' ),
    70                                                         'type'              => 'string',
    71                                                         'required'          => true,
    72                                                         'sanitize_callback' => 'esc_url_raw',
     71                                                        'description' => __( 'The URL of the resource for which to fetch oEmbed data.' ),
     72                                                        'required'    => true,
     73                                                        'type'        => 'string',
     74                                                        'format'      => 'uri',
    7375                                                ),
    7476                                                'format'    => array(
Note: See TracChangeset for help on using the changeset viewer.