Fixing reason lengths to char counts.

This commit is contained in:
Dessalines 2021-02-10 10:36:22 -05:00
parent 2e5ccaf7fe
commit acadf0289e
2 changed files with 2 additions and 2 deletions

View file

@ -672,7 +672,7 @@ impl Perform for CreateCommentReport {
if reason.is_empty() {
return Err(APIError::err("report_reason_required").into());
}
if reason.len() > 1000 {
if reason.chars().count() > 1000 {
return Err(APIError::err("report_too_long").into());
}

View file

@ -749,7 +749,7 @@ impl Perform for CreatePostReport {
if reason.is_empty() {
return Err(APIError::err("report_reason_required").into());
}
if reason.len() > 1000 {
if reason.chars().count() > 1000 {
return Err(APIError::err("report_too_long").into());
}