WordPress.org

Make WordPress Core

Ticket #44963: 44963.patch

File 44963.patch, 789 bytes (added by mukesh27, 3 years ago)

You have to add patch like attached.

  • wp-includes/rest-api.php

    diff -Naur /wp-includes/rest-api.php /wp-includes/rest-api.php
     
    10801080 * @return true|WP_Error
    10811081 */
    10821082function rest_validate_value_from_schema( $value, $args, $param = '' ) {
    1083         if ( 'array' === $args['type'] ) {
     1083        if ( isset( $args['type'] ) && 'array' === $args['type'] ) {
    10841084                if ( ! is_array( $value ) ) {
    10851085                        $value = preg_split( '/[\s,]+/', $value );
    10861086                }
     
    12211221 * @return true|WP_Error
    12221222 */
    12231223function rest_sanitize_value_from_schema( $value, $args ) {
    1224         if ( 'array' === $args['type'] ) {
     1224        if ( isset( $args['type'] ) && 'array' === $args['type'] ) {
    12251225                if ( empty( $args['items'] ) ) {
    12261226                        return (array) $value;
    12271227                }