From d33571f7d5a6d055673b3eee169b3d14e36f43a0 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 29 Nov 2019 21:59:03 +0000 Subject: [PATCH] REST API: Use a strict `in_array()` check in `WP_REST_Meta_Fields::get_registered_fields()`. Props dkarfa. Fixes #48839. Built from https://develop.svn.wordpress.org/trunk@46802 git-svn-id: http://core.svn.wordpress.org/trunk@46602 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/rest-api/fields/class-wp-rest-meta-fields.php | 6 +++--- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php b/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php index ba46ca2e67..a59ee7f90a 100644 --- a/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php +++ b/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php @@ -126,8 +126,8 @@ abstract class WP_REST_Meta_Fields { * * @since 4.7.0 * - * @param array $meta Array of meta parsed from the request. - * @param int $object_id Object ID to fetch meta for. + * @param array $meta Array of meta parsed from the request. + * @param int $object_id Object ID to fetch meta for. * @return null|WP_Error Null on success, WP_Error object on failure. */ public function update_value( $meta, $object_id ) { @@ -435,7 +435,7 @@ abstract class WP_REST_Meta_Fields { $rest_args['schema'] = $this->default_additional_properties_to_false( $rest_args['schema'] ); - if ( ! in_array( $type, array( 'string', 'boolean', 'integer', 'number', 'array', 'object' ) ) ) { + if ( ! in_array( $type, array( 'string', 'boolean', 'integer', 'number', 'array', 'object' ), true ) ) { continue; } diff --git a/wp-includes/version.php b/wp-includes/version.php index db6cf41c8e..714d1d5318 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.4-alpha-46801'; +$wp_version = '5.4-alpha-46802'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.