This commit is contained in:
naskya 2024-07-01 20:06:35 +09:00
parent 6e4e7f7386
commit 5388e7cb7b
Signed by: naskya
GPG key ID: 712D413B3A9FED5C

View file

@ -190,6 +190,11 @@ fn validate_email_struct(value: &Email) -> Result<(), ValidationError> {
fn validate_emoji(value: &str) -> Result<(), ValidationError> { fn validate_emoji(value: &str) -> Result<(), ValidationError> {
let error = Err(ValidationError::new("not a Unicode emoji or :emoji_code:")); let error = Err(ValidationError::new("not a Unicode emoji or :emoji_code:"));
// "star", "heart", "good" are explicitly allowed
if ["star", "heart", "good"].contains(&value) {
return Ok(());
}
// check if `value` is a Unicode emoji // check if `value` is a Unicode emoji
if emojis::get(value).is_some() { if emojis::get(value).is_some() {
return Ok(()); return Ok(());