Make WordPress Core

Changeset 46802


Ignore:
Timestamp:
11/29/2019 09:57:09 PM (5 years ago)
Author:
SergeyBiryukov
Message:

REST API: Use a strict in_array() check in WP_REST_Meta_Fields::get_registered_fields().

Props dkarfa.
Fixes #48839.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php

    r46696 r46802  
    127127     * @since 4.7.0
    128128     *
    129      * @param array           $meta      Array of meta parsed from the request.
    130      * @param int             $object_id Object ID to fetch meta for.
     129     * @param array $meta      Array of meta parsed from the request.
     130     * @param int   $object_id Object ID to fetch meta for.
    131131     * @return null|WP_Error Null on success, WP_Error object on failure.
    132132     */
     
    436436            $rest_args['schema'] = $this->default_additional_properties_to_false( $rest_args['schema'] );
    437437
    438             if ( ! in_array( $type, array( 'string', 'boolean', 'integer', 'number', 'array', 'object' ) ) ) {
     438            if ( ! in_array( $type, array( 'string', 'boolean', 'integer', 'number', 'array', 'object' ), true ) ) {
    439439                continue;
    440440            }
Note: See TracChangeset for help on using the changeset viewer.