From 55378bd29552fe505707c17b6af36612db7bcb22 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 13 Sep 2019 03:06:55 +0000 Subject: [PATCH] REST API: Use correct parameter name in `rest_validate_value_from_schema()` error messages. Props manzoorwanijk. Fixes #47905. Built from https://develop.svn.wordpress.org/trunk@46101 git-svn-id: http://core.svn.wordpress.org/trunk@45913 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/rest-api.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/rest-api.php b/wp-includes/rest-api.php index 89c4e6bb3a..4b49ebfdcb 100644 --- a/wp-includes/rest-api.php +++ b/wp-includes/rest-api.php @@ -1215,7 +1215,7 @@ function rest_validate_value_from_schema( $value, $args, $param = '' ) { if ( 'boolean' === $args['type'] && ! rest_is_boolean( $value ) ) { /* translators: 1: Parameter, 2: Type name. */ - return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not of type %2$s.' ), $value, 'boolean' ) ); + return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not of type %2$s.' ), $param, 'boolean' ) ); } if ( 'string' === $args['type'] && ! is_string( $value ) ) { @@ -1239,7 +1239,7 @@ function rest_validate_value_from_schema( $value, $args, $param = '' ) { case 'ip': if ( ! rest_is_ip_address( $value ) ) { /* translators: %s: IP address. */ - return new WP_Error( 'rest_invalid_param', sprintf( __( '%s is not a valid IP address.' ), $value ) ); + return new WP_Error( 'rest_invalid_param', sprintf( __( '%s is not a valid IP address.' ), $param ) ); } break; } diff --git a/wp-includes/version.php b/wp-includes/version.php index de471f5a03..a9c177a11b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-46100'; +$wp_version = '5.3-alpha-46101'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.