diff --git a/wp-includes/rest-api.php b/wp-includes/rest-api.php index 64d42cf0c0..2d6ecde631 100644 --- a/wp-includes/rest-api.php +++ b/wp-includes/rest-api.php @@ -1393,6 +1393,12 @@ function rest_validate_value_from_schema( $value, $args, $param = '' ) { return new WP_Error( 'rest_invalid_param', sprintf( __( '%s is not a valid IP address.' ), $param ) ); } break; + case 'uuid': + if ( ! wp_is_uuid( $value ) ) { + /* translators: %s is the name of a JSON field expecting a valid uuid. */ + return new WP_Error( 'rest_invalid_uuid', sprintf( __( '%s is not a valid UUID.' ), $param ) ); + } + break; } } @@ -1549,6 +1555,9 @@ function rest_sanitize_value_from_schema( $value, $args ) { case 'ip': return sanitize_text_field( $value ); + + case 'uuid': + return sanitize_text_field( $value ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 11a843c780..085c37a58f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-alpha-47752'; +$wp_version = '5.5-alpha-47753'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.