Answer the question
In order to leave comments, you need to log in
How to disable scripts and links in nodejs?
Hello. Tell me how to remake preg_match for js script for chat to disable links and scripts?
Here is the code
if(preg_match("/href|url|http|https|www|.ru|.com|.net|.info|csgo|winner|ru|xyz|com|script|img|net|info|.org/i", $messages)) {
return response()->json(['message' => 'Ссылки и скрипты запрещены!', 'status' => 'error']);
}
socket.on('create custom event', function(msg) {
let json = JSON.parse(msg);
currentSpecialEvent = {
reward: 1,
text: json.question
};
eventText = json.question;
eventAnswer = json.answer;
eventInterval = 300000;
io.emit('event', JSON.stringify(currentSpecialEvent));
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question