Fixing reason lengths to char counts.

pull/1422/head
Dessalines 3 years ago
parent 2e5ccaf7fe
commit acadf0289e

@ -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());
}

@ -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());
}

Loading…
Cancel
Save