# 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.
--- E:\documents\projects\_client\www\wordpress\wp-includes\meta.php
+++ E:\documents\projects\_client\www\wordpress\wp-includes\Copy of meta.php
@@ -109,18 +109,18 @@
 	if ( ! $meta_id = $wpdb->get_var( $wpdb->prepare( "SELECT $id_column FROM $table WHERE meta_key = %s AND $column = %d", $meta_key, $object_id ) ) )
 		return add_metadata($meta_type, $object_id, $meta_key, $meta_value);
 
+	$_meta_value = $meta_value;
+	$meta_value = maybe_serialize( stripslashes_deep($meta_value) );
+
 	// Compare existing value to new value if no prev value given and the key exists only once.
 	if ( empty($prev_value) ) {
 		$old_value = get_metadata($meta_type, $object_id, $meta_key);
 		if ( count($old_value) == 1 ) {
-			if ( $old_value[0] == $meta_value )
+			if ( maybe_serialize( stripslashes_deep($old_value[0])) == $meta_value )
 				return false;
 		}
 	}
 
-	$_meta_value = $meta_value;
-	$meta_value = maybe_serialize( stripslashes_deep($meta_value) );
-
 	$data  = compact( 'meta_value' );
 	$where = array( $column => $object_id, 'meta_key' => $meta_key );
 
