diff -Naur /wp-includes/rest-api.php /wp-includes/rest-api.php
|
|
|
|
| 1080 | 1080 | * @return true|WP_Error |
| 1081 | 1081 | */ |
| 1082 | 1082 | function rest_validate_value_from_schema( $value, $args, $param = '' ) { |
| 1083 | | if ( 'array' === $args['type'] ) { |
| | 1083 | if ( isset( $args['type'] ) && 'array' === $args['type'] ) { |
| 1084 | 1084 | if ( ! is_array( $value ) ) { |
| 1085 | 1085 | $value = preg_split( '/[\s,]+/', $value ); |
| 1086 | 1086 | } |
| … |
… |
|
| 1221 | 1221 | * @return true|WP_Error |
| 1222 | 1222 | */ |
| 1223 | 1223 | function rest_sanitize_value_from_schema( $value, $args ) { |
| 1224 | | if ( 'array' === $args['type'] ) { |
| | 1224 | if ( isset( $args['type'] ) && 'array' === $args['type'] ) { |
| 1225 | 1225 | if ( empty( $args['items'] ) ) { |
| 1226 | 1226 | return (array) $value; |
| 1227 | 1227 | } |