Changeset 44546 for trunk/src/wp-includes/rest-api.php
- Timestamp:
- 01/10/2019 09:05:50 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api.php
r44173 r44546 680 680 $data = $response->get_data(); 681 681 682 $fields = is_array( $request['_fields'] ) ? $request['_fields'] : preg_split( '/[\s,]+/',$request['_fields'] );682 $fields = wp_parse_list( $request['_fields'] ); 683 683 684 684 if ( 0 === count( $fields ) ) { … … 1110 1110 function rest_validate_value_from_schema( $value, $args, $param = '' ) { 1111 1111 if ( 'array' === $args['type'] ) { 1112 if ( ! is_ array( $value ) ) {1113 $value = preg_split( '/[\s,]+/',$value );1112 if ( ! is_null( $value ) ) { 1113 $value = wp_parse_list( $value ); 1114 1114 } 1115 1115 if ( ! wp_is_numeric_array( $value ) ) { … … 1254 1254 return (array) $value; 1255 1255 } 1256 if ( ! is_array( $value ) ) { 1257 $value = preg_split( '/[\s,]+/', $value ); 1258 } 1256 $value = wp_parse_list( $value ); 1259 1257 foreach ( $value as $index => $v ) { 1260 1258 $value[ $index ] = rest_sanitize_value_from_schema( $v, $args['items'] );
Note: See TracChangeset
for help on using the changeset viewer.