- Timestamp:
- 12/13/2018 04:29:57 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/5.0 merged: 43740
- Property svn:mergeinfo changed
-
trunk/src/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php
r43571 r44113 318 318 } 319 319 320 $meta_key = wp_slash( $meta_key );321 $meta_value = wp_slash( $value );322 323 320 // Do the exact same check for a duplicate value as in update_metadata() to avoid update_metadata() returning false. 324 321 $old_value = get_metadata( $meta_type, $object_id, $meta_key ); 322 $subtype = get_object_subtype( $meta_type, $object_id ); 325 323 326 324 if ( 1 === count( $old_value ) ) { 327 if ( $old_value[0] === $meta_value) {325 if ( (string) sanitize_meta( $meta_key, $value, $meta_type, $subtype ) === $old_value[0] ) { 328 326 return true; 329 327 } 330 328 } 331 329 332 if ( ! update_metadata( $meta_type, $object_id, $meta_key, $meta_value) ) {330 if ( ! update_metadata( $meta_type, $object_id, wp_slash( $meta_key ), wp_slash( $value ) ) ) { 333 331 return new WP_Error( 334 332 'rest_meta_database_error',
Note: See TracChangeset
for help on using the changeset viewer.