From 8bac781ff9aa829f5f6135579d6e69964504f784 Mon Sep 17 00:00:00 2001 From: Michael Housh Date: Thu, 2 Jan 2025 08:11:30 -0500 Subject: [PATCH] feat: Updating check for bad words --- Sources/App/Models/BadWords.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/App/Models/BadWords.swift b/Sources/App/Models/BadWords.swift index 83e522a..8422028 100644 --- a/Sources/App/Models/BadWords.swift +++ b/Sources/App/Models/BadWords.swift @@ -4,7 +4,7 @@ import Vapor func checkForBadWords(in string: String) throws { let split = string.split(separator: "\n") 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.") } }