Spam email from website form
Permalink 1 user found helpfulI've been thinking about creating an add-on package to address this problem, bur feel like it's something the core should address directly.
The current middleware approach to this problem seems very convoluted (to me at least) at this time...
I have clients that get hammered by russian Cialis, Viagra, etc.
Waste of server resources, DoS, etc. long before the email delivery should be involved...
Maybe this?
$th = $app->make('helper/text'); $th->match($pattern, $value); // Determine if a given string matches a given pattern
Or there's a Concrete/Core/Validation/BannedWord/BannedWordList, see the Conversations for example and /concrete/blocks/core_conversation_message/controller.php. Banned words added in the Dashboard > System & Settings > Conversations > Banned Words are saved in the database (table BannedWords) and then checked for in the conversation message validate_composer().
https://www.concrete5.org/marketplace/addons/contact-form1/...
I'm not familiar with express forms, but all you need to do is to add the below piece of code into the validation function and change/add the input fields accordingly:
use Concrete\Core\Support\Facade\Config; $e = $this->app->make('helper/validation/error'); if (Config::get('conversations.banned_words') && ( $this->app->make('helper/validation/banned_words')->hasBannedWords($name) || $this->app->make('helper/validation/banned_words')->hasBannedWords($message))) { return $e; }
Tim
Have you enabled the Banned Words in Dashboard > System & Settings > Conversations > Banned Words?
I'm using the Advanced Contact Form (screenshot of icon and editing window attached)
Banned Words is enabled (screenshot attached).
Thanks,
Tim
Strange, it works for me (see attached)
https://www.concrete5.org/marketplace/addons/akismet...