fix: mark all notifications as read/unread

fix: check profile status, warning, and biography length
fix: check post warning and tags length
This commit is contained in:
trisua 2025-05-28 13:06:48 -04:00
parent 3f6f1eda9f
commit 013bc0b45f
4 changed files with 54 additions and 8 deletions

View file

@ -105,6 +105,18 @@ pub async fn update_user_settings_request(
return Json(Error::DataTooLong("display name".to_string()).into());
}
if req.warning.len() > 2048 {
return Json(Error::DataTooLong("warning".to_string()).into());
}
if req.status.len() > 256 {
return Json(Error::DataTooLong("status".to_string()).into());
}
if req.biography.len() > 4096 {
return Json(Error::DataTooLong("warning".to_string()).into());
}
// check percentage themes
if !req.theme_sat.is_empty() && !req.theme_sat.ends_with("%") {
req.theme_sat = format!("{}%", req.theme_sat)