From 12fa80c7c049d5107a72ae4d0cb3908b8edea10f Mon Sep 17 00:00:00 2001 From: trisua Date: Sat, 2 Aug 2025 17:38:59 -0400 Subject: [PATCH] add: signature character limits --- crates/app/src/routes/api/v1/auth/profile.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/app/src/routes/api/v1/auth/profile.rs b/crates/app/src/routes/api/v1/auth/profile.rs index aec31ef..c5bbcc1 100644 --- a/crates/app/src/routes/api/v1/auth/profile.rs +++ b/crates/app/src/routes/api/v1/auth/profile.rs @@ -144,6 +144,14 @@ pub async fn update_user_settings_request( return Json(Error::DataTooLong("warning".to_string()).into()); } + if req.mail_signature.len() > 2048 { + return Json(Error::DataTooLong("mail signature".to_string()).into()); + } + + if req.forum_signature.len() > 2048 { + return Json(Error::DataTooLong("forum signature".to_string()).into()); + } + // check percentage themes if !req.theme_sat.is_empty() && !req.theme_sat.ends_with("%") { req.theme_sat = format!("{}%", req.theme_sat)