Don't show error message when updating a custom field without changing its value. see #10254

git-svn-id: http://svn.automattic.com/wordpress/trunk@11644 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-06-26 06:19:54 +00:00
parent 8483a08d39
commit 0c8f4cba63

View File

@ -814,8 +814,10 @@ case 'add-meta' :
die('0'); // if meta doesn't exist
if ( !current_user_can( 'edit_post', $meta->post_id ) )
die('-1');
if ( $meta->meta_value != stripslashes($value) ) {
if ( !$u = update_meta( $mid, $key, $value ) )
die('0'); // We know meta exists; we also know it's unchanged (or DB error, in which case there are bigger problems).
}
$key = stripslashes($key);
$value = stripslashes($value);