Make WordPress Core

Ticket #13350: meta.php.2.patch

File meta.php.2.patch, 1.3 KB (added by jayarjo, 16 years ago)
  • E:\documents\projects\_client\www\wordpress\wp-includes\

    # This patch file was generated by NetBeans IDE
    # This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
    # It uses platform neutral UTF-8 encoding.
    # Above lines and this line are ignored by the patching process.
    old new  
    109109        if ( ! $meta_id = $wpdb->get_var( $wpdb->prepare( "SELECT $id_column FROM $table WHERE meta_key = %s AND $column = %d", $meta_key, $object_id ) ) )
    110110                return add_metadata($meta_type, $object_id, $meta_key, $meta_value);
    111111
     112        $_meta_value = $meta_value;
     113        $meta_value = maybe_serialize( stripslashes_deep($meta_value) );
     114
    112115        // Compare existing value to new value if no prev value given and the key exists only once.
    113116        if ( empty($prev_value) ) {
    114117                $old_value = get_metadata($meta_type, $object_id, $meta_key);
    115118                if ( count($old_value) == 1 ) {
    116                         if ( $old_value[0] == $meta_value )
     119                        if ( maybe_serialize( stripslashes_deep($old_value[0])) == $meta_value )
    117120                                return false;
    118121                }
    119122        }
    120123
    121         $_meta_value = $meta_value;
    122         $meta_value = maybe_serialize( stripslashes_deep($meta_value) );
    123 
    124124        $data  = compact( 'meta_value' );
    125125        $where = array( $column => $object_id, 'meta_key' => $meta_key );
    126126