From 0082765bf63e13878a68a85831372e497bcdd352 Mon Sep 17 00:00:00 2001 From: ashley Date: Tue, 24 Sep 2024 13:48:22 +0000 Subject: [PATCH] add stuff --- html/search.ejs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/html/search.ejs b/html/search.ejs index dd4d33e0..f739a676 100644 --- a/html/search.ejs +++ b/html/search.ejs @@ -667,14 +667,14 @@ function extractQueryFromUpsellMessage(message) { <% const searchStrings = [ - "suicide", "self harm", "self-harm", "support", "murder", "how to murder", "kill myself", - "end my life", "depressed", "depression", "lonely", - "hurt myself", "selfharm", "selfharm", "dying", "want to die", - "kill", "die", "family problems", "family issues", "abuse", - "domestic violence", "abusive parents", "family conflict", - "estranged", "disowned", "run away", "runaway", ".full stop punctuation." + "\\bsuicide\\b", "\\bself harm\\b", "\\bself-harm\\b", "\\bsupport\\b", "\\bmurder\\b", + "\\bhow to murder\\b", "\\bkill myself\\b", "\\bend my life\\b", "\\bdepressed\\b", + "\\bdepression\\b", "\\blonely\\b", "\\bhurt myself\\b", "\\bselfharm\\b", "\\bdying\\b", + "\\bwant to die\\b", "\\bkill\\b", "\\bdie\\b", "\\bfamily problems\\b", "\\bfamily issues\\b", + "\\babuse\\b", "\\bdomestic violence\\b", "\\babusive parents\\b", "\\bfamily conflict\\b", + "\\bestranged\\b", "\\bdisowned\\b", "\\brun away\\b", "\\brunaway\\b", "\\b.full stop punctuation.\\b" ]; -if (searchStrings.some(str => q.toLowerCase().includes(str))) { +if (searchStrings.some(str => new RegExp(str, 'i').test(q))) { %>