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. git-svn-id: https://develop.svn.wordpress.org/trunk@47755 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
7d24075a26
commit
6ab90a209d
@ -40,8 +40,10 @@ final class WP_oEmbed_Controller {
|
|||||||
'callback' => array( $this, 'get_item' ),
|
'callback' => array( $this, 'get_item' ),
|
||||||
'args' => array(
|
'args' => array(
|
||||||
'url' => array(
|
'url' => array(
|
||||||
|
'description' => __( 'The URL of the resource for which to fetch oEmbed data.' ),
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'sanitize_callback' => 'esc_url_raw',
|
'type' => 'string',
|
||||||
|
'format' => 'uri',
|
||||||
),
|
),
|
||||||
'format' => array(
|
'format' => array(
|
||||||
'default' => 'json',
|
'default' => 'json',
|
||||||
@ -67,9 +69,9 @@ final class WP_oEmbed_Controller {
|
|||||||
'args' => array(
|
'args' => array(
|
||||||
'url' => array(
|
'url' => array(
|
||||||
'description' => __( 'The URL of the resource for which to fetch oEmbed data.' ),
|
'description' => __( 'The URL of the resource for which to fetch oEmbed data.' ),
|
||||||
'type' => 'string',
|
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'sanitize_callback' => 'esc_url_raw',
|
'type' => 'string',
|
||||||
|
'format' => 'uri',
|
||||||
),
|
),
|
||||||
'format' => array(
|
'format' => array(
|
||||||
'description' => __( 'The oEmbed format to use.' ),
|
'description' => __( 'The oEmbed format to use.' ),
|
||||||
|
Loading…
Reference in New Issue
Block a user