From c92abe0294952d2a4d63f3babfea5f9f350b50a8 Mon Sep 17 00:00:00 2001 From: Tempe Techie <95053628+tempe-techie@users.noreply.github.com> Date: Sat, 10 Feb 2024 10:10:42 +0100 Subject: [PATCH] completely remove chat referral links --- utils/textUtils.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/utils/textUtils.js b/utils/textUtils.js index 759a40a8..daf86172 100644 --- a/utils/textUtils.js +++ b/utils/textUtils.js @@ -390,10 +390,11 @@ export function urlParsing(text) { return text.replace(urlRegex, function(url) { - // remove referrals from our website links - if (url.startsWith(window.location.origin)) { + // remove this website referrals from the chat + if (url.startsWith(window.location.origin) || url.startsWith(String(window.location.origin).replace("https://", "http://"))) { if (url.includes("ref=")) { - url = url.replace("ref=", "noref="); // the easiest solution to not break a URL + //url = url.replace("ref=", "noref="); // the easiest solution to not break a URL + return "(referral links not allowed)"; } }