feat: Updating check for bad words
This commit is contained in:
@@ -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.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user