mirror of
https://gitlab.com/etc404/software-engineering-project.git
synced 2026-05-10 20:52:58 +00:00
different approach to filtering and old extensive list
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
function isProfane(str) {
|
function isProfane(str) {
|
||||||
const lower = str.toLowerCase().trim();
|
const lower = str.toLowerCase().trim();
|
||||||
return bannedWords.some(word => word === lower);
|
return bannedWords.some(word => new RegExp(`\\b${word}\\b`).test(lower));
|
||||||
}
|
}
|
||||||
|
|
||||||
function showError(input, message) {
|
function showError(input, message) {
|
||||||
|
|||||||
@@ -115,7 +115,7 @@
|
|||||||
|
|
||||||
function isProfane(str) {
|
function isProfane(str) {
|
||||||
const lower = str.toLowerCase().trim();
|
const lower = str.toLowerCase().trim();
|
||||||
return bannedWords.some(word => word === lower);
|
return bannedWords.some(word => new RegExp(`\\b${word}\\b`).test(lower));
|
||||||
}
|
}
|
||||||
const ingredientContainer = document.getElementById('ingredients-container');
|
const ingredientContainer = document.getElementById('ingredients-container');
|
||||||
const stepsContainer = document.getElementById('steps-container');
|
const stepsContainer = document.getElementById('steps-container');
|
||||||
|
|||||||
@@ -106,7 +106,7 @@
|
|||||||
<script>
|
<script>
|
||||||
function isProfane(str) {
|
function isProfane(str) {
|
||||||
const lower = str.toLowerCase();
|
const lower = str.toLowerCase();
|
||||||
return bannedWords.some(word => lower.includes(word));
|
return bannedWords.some(word => new RegExp(`\\b${word}\\b`).test(lower));
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -119,7 +119,7 @@
|
|||||||
|
|
||||||
function isProfane(str) {
|
function isProfane(str) {
|
||||||
const lower = str.toLowerCase().trim();
|
const lower = str.toLowerCase().trim();
|
||||||
return bannedWords.some(word => word === lower);
|
return bannedWords.some(word => new RegExp(`\\b${word}\\b`).test(lower));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user