Changeset 42000 for trunk/src/wp-includes/rest-api.php
- Timestamp:
- 10/24/2017 09:04:50 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api.php
r41744 r42000 1107 1107 1108 1108 foreach ( $value as $property => $v ) { 1109 if ( !isset( $args['properties'][ $property ] ) ) {1110 continue;1111 }1112 $is_valid = rest_validate_value_from_schema( $v, $args['properties'][ $property ], $param . '[' . $property . ']' );1113 1114 if ( is_wp_error( $is_valid )) {1115 return $is_valid;1109 if ( isset( $args['properties'][ $property ] ) ) { 1110 $is_valid = rest_validate_value_from_schema( $v, $args['properties'][ $property ], $param . '[' . $property . ']' ); 1111 if ( is_wp_error( $is_valid ) ) { 1112 return $is_valid; 1113 } 1114 } elseif ( isset( $args['additionalProperties'] ) && false === $args['additionalProperties'] ) { 1115 return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not a valid property of Object.' ), $property ) ); 1116 1116 } 1117 1117 } … … 1247 1247 1248 1248 foreach ( $value as $property => $v ) { 1249 if ( ! isset( $args['properties'][ $property ] ) ) { 1249 if ( isset( $args['properties'][ $property ] ) ) { 1250 $value[ $property ] = rest_sanitize_value_from_schema( $v, $args['properties'][ $property ] ); 1251 } elseif ( isset( $args['additionalProperties'] ) && false === $args['additionalProperties'] ) { 1250 1252 unset( $value[ $property ] ); 1251 continue;1252 1253 } 1253 $value[ $property ] = rest_sanitize_value_from_schema( $v, $args['properties'][ $property ] );1254 1254 } 1255 1255
Note: See TracChangeset
for help on using the changeset viewer.