I
I
Igor Vasiliev2018-04-24 04:55:13
Yii
Igor Vasiliev, 2018-04-24 04:55:13

How to make stop words in Yii2?

Hello
-
Maybe someone will misunderstand me, or appreciate my idea, or something similar has already been done. I want to create a spam filter from my site. The principle is this: I did validation to check the correctness of the specified crypto wallet, through the API - everything works, but not immediately, but after pressing the submit button, maybe I did something wrong, since the standard validation works immediately as soon as I entered or did not enter information in input. Since you can create your functions with validation in Yii, and they work regardless of whether before or after submitting the form, you can also get confused with the stop words that spammers usually write in site messages. Captcha from google will not help, just captcha, and what pattern should I write so that the message field catches suspicious words?
Therefore, you need to create an array with stop words, by analogy with the foul language validator. But the last validator is easier to create. Why? Because there are obvious words that cannot be confused with cultural speech.
What is the complexity of a personal anti-spam validator. For example, I inserted the word "buy" into the array. And let's imagine a fictional Uncle Sam, who regularly bombards the site with messages "you can buy Swiss watches, only from us, with a 50% discount." In order not to be distracted by spam, and not to analyze and delete letters, it is easier to create a validator that does not warn, but on the contrary, says that it was sent, blunting the vigilance of the attacker, but in fact the letter is not sent, it is immediately deleted before being on mail. But Petya comes and writes. "I tried to buy a table lamp from you, but it was not added to the basket, and I did not have time to buy it at a discount." This message not only does not give an opportunity to give a cuff to the negligent programmer, who on that ill-fated day did not complete the basket, but also lost the client,
write a bot? Or, all the same, create obvious stop words, which are more like phrases that do not fit in any way with the activities of the store, not with the activities of the site. And then delete them before the message arrives safely in the mail. Now someone may be choking with laughter, but having estimated the scale, let me explain, imagine that over 200,000 letters came to the site and mail in a day, the next day the same number or a little more, according to statistics, for example, 50,000 letters on the case, 10120 letters, for example, are just jokers - and as you wanted, trolls are everywhere))) And the rest is SPAM.
You see, it’s not you, not your hired person, who will not be able to process so much information in a day, after 8 hours the eyepieces and the fifth point already hurt at the monitor, and more time spent at the computer and even more damage to health.
So jokes aside. When the task in the bud is not solved correctly, with global growth, it will be difficult to eliminate the leak. It is equivalent to one person to keep the sinking Titanic afloat.
I think the meaning of this validator and the problem are clear.
QUESTION: What is the best way to implement such a validator, what is the best thing to do? What approach is needed here? Did someone similar? If yes, what came of it?
PS Perhaps someone will say, why delete them, write them to the database, and delete letters marked as suspicious via cron. In this case, the meaning of the validator is completely lost. Why do we need such a script to solve problems with spam, if for it then we still have to revise and redo everything. They invented a sieve, filters, so that one thing remains, and something else is lost. Need advice, logic, and constructive explanations.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Mykola, 2018-04-24
@Isolution666

Maybe you could look at something like this: https://github.com/IQAndreas/php-spam-filter ? Just add words-rules for Russian.

M
Maxim Fedorov, 2018-04-24
@qonand

eh, not what you are doing... Your validator will not solve the problem effectively. The topic of spam protection is too broad to be solved by writing a simple validator. Do not reinvent the wheel, better get acquainted with the existing methods of protecting them now, thank God, there are plenty of them, from Google spam filters to firewalls and special services that analyze the text of messages. Study the topic in more detail, and do not solve the problem "on the forehead"

I
Igor Vasiliev, 2020-03-05
@Isolution666

The most reasonable decision that I ever came up with, although a lot of time has passed since I asked this question - so this is this page - fspamlist.com/index.php?c=api
By API, we check as many as 3 parameters - email , login , IP-adress
What this tool gives ))) If at least one of the parameters returns FALSE , we can deny the user anything (registration, authorization, comment, sending messages)
I already wrote validators for Yii2 related to the API, so that the check can be hung up at least on any input field, or in general on everything, the point is, in principle, to check who is trying to break into the input fields, and if this user is on the SPAM blacklist, then we send him a ban.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question