From ede6e8f8e472138291a5ab6d47c082e1ac97ba34 Mon Sep 17 00:00:00 2001 From: jvyden Date: Tue, 22 Feb 2022 16:27:32 -0500 Subject: [PATCH] Limit length of comments to 100 characters --- ProjectLighthouse/Database.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ProjectLighthouse/Database.cs b/ProjectLighthouse/Database.cs index abb0977a..385982bf 100644 --- a/ProjectLighthouse/Database.cs +++ b/ProjectLighthouse/Database.cs @@ -144,6 +144,8 @@ public class Database : DbContext public async Task PostComment(User user, int targetId, CommentType type, string message) { + if (message.Length > 100) return false; + if (type == CommentType.Profile) { User? targetUser = await this.Users.FirstOrDefaultAsync(u => u.UserId == targetId);