Fixing reason lengths to char counts.

pull/1422/head
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() { if reason.is_empty() {
return Err(APIError::err("report_reason_required").into()); 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()); return Err(APIError::err("report_too_long").into());
} }

View File

@ -749,7 +749,7 @@ impl Perform for CreatePostReport {
if reason.is_empty() { if reason.is_empty() {
return Err(APIError::err("report_reason_required").into()); 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()); return Err(APIError::err("report_too_long").into());
} }