Skip to content

Commit

Permalink
completely remove chat referral links
Browse files Browse the repository at this point in the history
  • Loading branch information
tempe-techie committed Feb 10, 2024
1 parent 77ca613 commit c92abe0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions utils/textUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)";
}
}

Expand Down

0 comments on commit c92abe0

Please sign in to comment.