From 0c8f4cba63a52f162c2252fd5305cbaf48f79f99 Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 26 Jun 2009 06:19:54 +0000 Subject: [PATCH] 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 --- wp-admin/admin-ajax.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 1fd0df5342..7f131e8ff1 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -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 ( !$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). + 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);