diff --git a/homepage/guestbook.js b/homepage/guestbook.js index 328f30f..bfd755e 100644 --- a/homepage/guestbook.js +++ b/homepage/guestbook.js @@ -64,9 +64,11 @@ exports.addPost = async (post) => { if (post.message === undefined || post.message === "") return reject("empty message"); - + if (post.message.includes("")) - 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";