feat: Updating check for bad words

This commit is contained in:
2025-01-02 08:11:30 -05:00
parent 6b3f822c9f
commit 8bac781ff9

View File

@@ -4,7 +4,7 @@ import Vapor
func checkForBadWords(in string: String) throws { func checkForBadWords(in string: String) throws {
let split = string.split(separator: "\n") let split = string.split(separator: "\n")
for string in split { for string in split {
for word in badWords where string.contains(word) { for word in badWords where string.lowercased().contains(word) {
throw Abort(.badRequest, reason: "Stop using such naughty language.") throw Abort(.badRequest, reason: "Stop using such naughty language.")
} }
} }