WordPress.org

Make WordPress Core

Ticket #44949: 44949.patch

File 44949.patch, 762 bytes (added by jason_the_adams, 3 years ago)
  • src/wp-includes/rest-api.php

    diff --git a/src/wp-includes/rest-api.php b/src/wp-includes/rest-api.php
    index 26ca9297ff..0cce9fa62f 100644
    a b function rest_validate_value_from_schema( $value, $args, $param = '' ) { 
    11441144                return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not of type %2$s.' ), $param, 'string' ) );
    11451145        }
    11461146
    1147         if ( 'string' === $args['type'] && ! empty( $args['pattern'] ) ) {
    1148             if ( ! preg_match( $args['pattern'], $value ) ) {
    1149                     return new WP_Error( 'rest_invalid_pattern', sprintf( __( '%1$s does not match pattern %s$s.' ), $param, $args['pattern'] ) );
    1150         }
    1151     }
    1152 
    11531147        if ( isset( $args['format'] ) ) {
    11541148                switch ( $args['format'] ) {
    11551149                        case 'date-time':