Skip to content

Commit

Permalink
Fix My Account page can't change the real name
Browse files Browse the repository at this point in the history
Regression caused by a80f447 which introduced
strict comparison on return value of user_get_id_by_name. The function
returns false when user id is not found, but the code was still
comparing against 0.

Fixes #16519
  • Loading branch information
dregad committed Oct 21, 2013
1 parent e9dbfe1 commit 21d36d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/user_api.php
Expand Up @@ -265,7 +265,7 @@ function user_is_realname_unique( $p_username, $p_realname ) {
# but allow it to match the current user
$t_target_user = user_get_id_by_name( $p_username );
$t_other_user = user_get_id_by_name( $p_realname );
if( ( 0 !== $t_other_user ) && ( $t_target_user !== $t_other_user ) ) {
if( ( false !== $t_other_user ) && ( $t_target_user !== $t_other_user ) ) {
return 0;
}

Expand Down

0 comments on commit 21d36d7

Please sign in to comment.