No links are allowed. Not even domain names. :)
This commit is contained in:
parent
b14a6dbed4
commit
bea24e50b0
@ -64,9 +64,11 @@ exports.addPost = async (post) => {
|
|||||||
|
|
||||||
if (post.message === undefined || post.message === "")
|
if (post.message === undefined || post.message === "")
|
||||||
return reject("empty message");
|
return reject("empty message");
|
||||||
|
|
||||||
if (post.message.includes("</a>"))
|
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 === "")
|
if (post.name === undefined || post.name === "")
|
||||||
post.name = "Anonymous";
|
post.name = "Anonymous";
|
||||||
|
Loading…
Reference in New Issue
Block a user