No links are allowed. Not even domain names. :)

This commit is contained in:
Alexander Andreev 2021-09-16 16:26:55 +04:00
parent b14a6dbed4
commit bea24e50b0
Signed by: Arav
GPG Key ID: 610DF2574456329F

View File

@ -66,7 +66,9 @@ exports.addPost = async (post) => {
return reject("empty message");
if (post.message.includes("</a>"))
return reject("spam");
return reject("links are not allowed");
if (post.message.match(/(https?)?(:\/\/)?\S+( +)?(\.|\(?dot\)?)( +)?\S+(( +)?\/.+)?/gmi))
return reject("links are not allowed");
if (post.name === undefined || post.name === "")
post.name = "Anonymous";