Don't create empty umeta values.

git-svn-id: http://svn.automattic.com/wordpress/trunk@3218 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt 2005-11-28 08:48:18 +00:00
parent e8a4812526
commit dced5779ea
1 changed files with 4 additions and 0 deletions

View File

@ -2114,6 +2114,10 @@ function update_usermeta( $user_id, $meta_key, $meta_value ) {
if ( is_array($meta_value) || is_object($meta_value) ) if ( is_array($meta_value) || is_object($meta_value) )
$meta_value = serialize($meta_value); $meta_value = serialize($meta_value);
$meta_value = trim( $meta_value );
if ( '' == $meta_value )
return false;
$cur = $wpdb->get_row("SELECT * FROM $wpdb->usermeta WHERE user_id = '$user_id' AND meta_key = '$meta_key'"); $cur = $wpdb->get_row("SELECT * FROM $wpdb->usermeta WHERE user_id = '$user_id' AND meta_key = '$meta_key'");
if ( !$cur ) { if ( !$cur ) {