From 1066f1addb65f76e825b44645e34cc6588aeb74a Mon Sep 17 00:00:00 2001 From: nacin Date: Thu, 29 Sep 2011 19:37:58 +0000 Subject: [PATCH] Pass unslashed values from update_metadata() to add_metadata(). fixes #17343. git-svn-id: http://svn.automattic.com/wordpress/trunk@18816 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/meta.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/meta.php b/wp-includes/meta.php index c203c535e4..3da7542ada 100644 --- a/wp-includes/meta.php +++ b/wp-includes/meta.php @@ -115,6 +115,7 @@ function update_metadata($meta_type, $object_id, $meta_key, $meta_value, $prev_v // expected_slashed ($meta_key) $meta_key = stripslashes($meta_key); + $passed_value = $meta_value; $meta_value = stripslashes_deep($meta_value); $meta_value = sanitize_meta( $meta_key, $meta_value, $meta_type ); @@ -123,7 +124,7 @@ function update_metadata($meta_type, $object_id, $meta_key, $meta_value, $prev_v return (bool) $check; 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); + return add_metadata($meta_type, $object_id, $meta_key, $passed_value); // Compare existing value to new value if no prev value given and the key exists only once. if ( empty($prev_value) ) {