WordPress.org

Make WordPress Core

Ticket #17343: 17343.diff

File 17343.diff, 892 bytes (added by nacin, 4 years ago)
  • wp-includes/meta.php

     
    115115 
    116116        // expected_slashed ($meta_key) 
    117117        $meta_key = stripslashes($meta_key); 
     118        $passed_value = $meta_value; 
    118119        $meta_value = stripslashes_deep($meta_value); 
    119120        $meta_value = sanitize_meta( $meta_key, $meta_value, $meta_type ); 
    120121 
     
    123124                return (bool) $check; 
    124125 
    125126        if ( ! $meta_id = $wpdb->get_var( $wpdb->prepare( "SELECT $id_column FROM $table WHERE meta_key = %s AND $column = %d", $meta_key, $object_id ) ) ) 
    126                 return add_metadata($meta_type, $object_id, $meta_key, $meta_value); 
     127                return add_metadata($meta_type, $object_id, $meta_key, $passed_value); 
    127128 
    128129        // Compare existing value to new value if no prev value given and the key exists only once. 
    129130        if ( empty($prev_value) ) {