mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-23 19:31:33 +00:00
Check for slurs in account creation. (#2443)
This commit is contained in:
parent
71aed94a00
commit
09246a20fb
1 changed files with 4 additions and 2 deletions
|
@ -26,7 +26,7 @@ use lemmy_db_views_actor::structs::PersonViewSafe;
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
claims::Claims,
|
claims::Claims,
|
||||||
error::LemmyError,
|
error::LemmyError,
|
||||||
utils::{check_slurs, is_valid_actor_name},
|
utils::{check_slurs, check_slurs_opt, is_valid_actor_name},
|
||||||
ConnectionId,
|
ConnectionId,
|
||||||
};
|
};
|
||||||
use lemmy_websocket::{messages::CheckCaptcha, LemmyContext};
|
use lemmy_websocket::{messages::CheckCaptcha, LemmyContext};
|
||||||
|
@ -99,7 +99,9 @@ impl PerformCrud for Register {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
check_slurs(&data.username, &context.settings().slur_regex())?;
|
let slur_regex = &context.settings().slur_regex();
|
||||||
|
check_slurs(&data.username, slur_regex)?;
|
||||||
|
check_slurs_opt(&data.answer, slur_regex)?;
|
||||||
|
|
||||||
let actor_keypair = generate_actor_keypair()?;
|
let actor_keypair = generate_actor_keypair()?;
|
||||||
if !is_valid_actor_name(&data.username, context.settings().actor_name_max_length) {
|
if !is_valid_actor_name(&data.username, context.settings().actor_name_max_length) {
|
||||||
|
|
Loading…
Reference in a new issue