webform_allowed_charactersets - settings
webform_allowed_charactersets - example cyrillic input
webform_allowed_charactersets - example invalid input validation

This project is not covered by Drupal’s security advisory policy.

Add characterset restrictions to your webforms. If you for example have russian spam still comming through your current anti-spam measures on your webforms, you can use this module to simply not allow cyrillic input. Then webforms will fail validation if russian/cyrillic characters are entered in any of the input fields so the form cannot be submitted.

Features

You can allow any of the 20 most common charactersets, like Latin, Cyrillic, Chinese, Japanese, Korean, ...
If you need a specific characterset that is not listed, please create an issue. It's rather simple to add one if you know the regex that can identify it. You can either set the module to add the validation on all webforms, or you can add the Webform Handler that this module provides to only the specific webforms where you would want to have characterset validation.

Installation

Get the module:
composer require drupal/webform_allowed_charactersets
Enable the module:
drush en webform_allowed_charactersets
Go to the settings page at:
/admin/structure/webform/config/charactersets
You can reach this via the menu via Structure -> Webforms -> Settings -> Allowed charactersets.
Apply the settings that you would like for your project.

Additional Requirements

This module is designed to be used for webforms. So Webforms is a required module.

Help to make it better

I welcome each and any ticket / issue to make this project better. The most useful are proposed patches / MRs so if they are community reviewd they can be implemented right away. Also: this module does not have tests at this moment. Any help with that will also be greatly appreciated. And one of the first issues I can think of myself is to have the validation message 'Invalid input' configurable.

So feel free to test / use this module, provide feedback and create issues to make it better.
If I can help even a few companies to get less spam, then I think creating this module was worth the effort.
We use this ourselves at our company for a few clients where spam still got through reCaptcha and Honeypot. Since that spam that got through was cyrillic text, this module is a great addition to work right besides the other anti-spam modules.

Supporting organizations: 
Brandle: Allowed me to work on this module during working hours

Project information

Releases