From: Dessalines Date: Wed, 10 Feb 2021 15:27:48 +0000 (-0500) Subject: Fixing display name limit. Fixes #1421 X-Git-Url: http://these/git/ui/assets/%7B%60https:/matrix.to?a=commitdiff_plain;h=2e5ccaf7fe7438badcaf65e4bc84f94de3e8d3be;p=lemmy.git Fixing display name limit. Fixes #1421 --- diff --git a/crates/utils/src/utils.rs b/crates/utils/src/utils.rs index b2a7c97e..62974356 100644 --- a/crates/utils/src/utils.rs +++ b/crates/utils/src/utils.rs @@ -110,8 +110,8 @@ pub fn is_valid_username(name: &str) -> bool { // Can't do a regex here, reverse lookarounds not supported pub fn is_valid_preferred_username(preferred_username: &str) -> bool { !preferred_username.starts_with('@') - && preferred_username.len() >= 3 - && preferred_username.len() <= 20 + && preferred_username.chars().count() >= 3 + && preferred_username.chars().count() <= 20 } pub fn is_valid_community_name(name: &str) -> bool {