WordPress.org

Make WordPress Core

Changeset 36509


Ignore:
Timestamp:
02/11/2016 05:34:59 PM (4 years ago)
Author:
boonebgorges
Message:

Don't double-unslash meta key when update_metadata() falls back on add_metadata().

Props jdgrimes.
Fixes #35795.

Location:
trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/meta.php

    r36420 r36509  
    162162
    163163    // expected_slashed ($meta_key)
     164    $raw_meta_key = $meta_key;
    164165    $meta_key = wp_unslash($meta_key);
    165166    $passed_value = $meta_value;
     
    199200    $meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT $id_column FROM $table WHERE meta_key = %s AND $column = %d", $meta_key, $object_id ) );
    200201    if ( empty( $meta_ids ) ) {
    201         return add_metadata($meta_type, $object_id, $meta_key, $passed_value);
     202        return add_metadata( $meta_type, $object_id, $raw_meta_key, $passed_value );
    202203    }
    203204
Note: See TracChangeset for help on using the changeset viewer.