mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-08 16:41:44 +01:00
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. Built from https://develop.svn.wordpress.org/trunk@47755 git-svn-id: http://core.svn.wordpress.org/trunk@47531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
717f0d0a3e
commit
facb1728b9
@ -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(
|
||||||
'required' => true,
|
'description' => __( 'The URL of the resource for which to fetch oEmbed data.' ),
|
||||||
'sanitize_callback' => 'esc_url_raw',
|
'required' => true,
|
||||||
|
'type' => 'string',
|
||||||
|
'format' => 'uri',
|
||||||
),
|
),
|
||||||
'format' => array(
|
'format' => array(
|
||||||
'default' => 'json',
|
'default' => 'json',
|
||||||
@ -66,10 +68,10 @@ final class WP_oEmbed_Controller {
|
|||||||
'permission_callback' => array( $this, 'get_proxy_item_permissions_check' ),
|
'permission_callback' => array( $this, 'get_proxy_item_permissions_check' ),
|
||||||
'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,
|
'type' => 'string',
|
||||||
'sanitize_callback' => 'esc_url_raw',
|
'format' => 'uri',
|
||||||
),
|
),
|
||||||
'format' => array(
|
'format' => array(
|
||||||
'description' => __( 'The oEmbed format to use.' ),
|
'description' => __( 'The oEmbed format to use.' ),
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.5-alpha-47754';
|
$wp_version = '5.5-alpha-47755';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user