Make WordPress Core

Changeset 14547


Ignore:
Timestamp:
05/10/2010 08:51:58 PM (14 years ago)
Author:
nacin
Message:

Revert patch for expecting unslashed data in the metadata API. Had snuck in with [14546]. see #12416.

File:
1 edited

Legend:

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

    r14546 r14547  
    2222 * @param string $meta_type Type of object metadata is for (e.g., comment, post, or user)
    2323 * @param int $object_id ID of the object metadata is for
    24  * @param string $meta_key Metadata key. Expected unslashed.
     24 * @param string $meta_key Metadata key
    2525 * @param string $meta_value Metadata value
    2626 * @param bool $unique Optional, default is false.  Whether the specified metadata key should be
     
    4343    $column = esc_sql($meta_type . '_id');
    4444
     45    // expected_slashed ($meta_key)
     46    $meta_key = stripslashes($meta_key);
     47
    4548    if ( $unique && $wpdb->get_var( $wpdb->prepare(
    4649        "SELECT COUNT(*) FROM $table WHERE meta_key = %s AND $column = %d",
     
    8083 * @param string $meta_type Type of object metadata is for (e.g., comment, post, or user)
    8184 * @param int $object_id ID of the object metadata is for
    82  * @param string $meta_key Metadata key. Expected unslashed.
     85 * @param string $meta_key Metadata key
    8386 * @param string $meta_value Metadata value
    8487 * @param string $prev_value Optional.  If specified, only update existing metadata entries with
     
    100103    $column = esc_sql($meta_type . '_id');
    101104    $id_column = 'user' == $meta_type ? 'umeta_id' : 'meta_id';
     105
     106    // expected_slashed ($meta_key)
     107    $meta_key = stripslashes($meta_key);
    102108
    103109    if ( ! $meta_id = $wpdb->get_var( $wpdb->prepare( "SELECT $id_column FROM $table WHERE meta_key = %s AND $column = %d", $meta_key, $object_id ) ) )
     
    138144 * @param string $meta_type Type of object metadata is for (e.g., comment, post, or user)
    139145 * @param int $object_id ID of the object metadata is for
    140  * @param string $meta_key Metadata key. Expected unslashed.
     146 * @param string $meta_key Metadata key
    141147 * @param string $meta_value Optional. Metadata value.  If specified, only delete metadata entries
    142148 *      with this value.  Otherwise, delete all entries with the specified meta_key.
     
    160166    $type_column = esc_sql($meta_type . '_id');
    161167    $id_column = 'user' == $meta_type ? 'umeta_id' : 'meta_id';
    162 
     168    // expected_slashed ($meta_key)
     169    $meta_key = stripslashes($meta_key);
    163170    $meta_value = maybe_serialize( stripslashes_deep($meta_value) );
    164171
Note: See TracChangeset for help on using the changeset viewer.