From 778c86af04bf55bc061455f3c6fa7f47ff066695 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 22 Nov 2021 14:20:09 -0500 Subject: [PATCH] Fix min title char count for post titles. Fixes #1854 --- crates/utils/src/utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/utils/src/utils.rs b/crates/utils/src/utils.rs index 1f3252ffa..f695b3ac4 100644 --- a/crates/utils/src/utils.rs +++ b/crates/utils/src/utils.rs @@ -137,7 +137,7 @@ pub fn is_valid_matrix_id(matrix_id: &str) -> bool { } pub fn is_valid_post_title(title: &str) -> bool { - VALID_POST_TITLE_REGEX.is_match(title) + VALID_POST_TITLE_REGEX.is_match(title) && title.chars().count() >= 3 && !title.contains('\n') } pub fn get_ip(conn_info: &ConnectionInfo) -> IpAddr {