Support

Admin Tools

#30442 Anti Spam Bad Words - Chinese and Korean words

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by on Friday, 07 December 2018 17:17 CST

lesprace
We are currently handling spam, which is written in Korean or Chinese, in Ads Manager for Joomla.
Spammer changes IP addresses (different countries), modifies registration emails with different domains but repeats text strings in spam.

We thought to block this activity by filtering bad words, but it does not work for Chinese or Korean characters.

Typical Spam Content:
代办温莎大学假毕业证成绩单办理微/Q603012914办理加拿大文凭学位证学历丨买加拿大假文凭假毕业证|办理国外大学毕

List of bad words is in attachment.

Probably for these special Chinese characters blocking does not work, any advice?

nicholas
Akeeba Staff
Manager
I believe that your issue has to do with the PHP version you are using. Upgrade to PHP 7.1 or 7.2 to resolve this issue.

The anti-spam bad words feature works through regular expressions. Regular Expressions need to be compiled and run against some text, returning matches (or signalling the complete lack thereof). All programming languages which support them, such as PHP, use a third party library to handle that bit. In the case og PHP, that's PCRE (Perl Compatible Regular Expressions).

There are two major versions of PCRE. The first version was originally released in 1997, that's over 20 years ago. The new version was released in 2015. The old version does not support some extended Unicode characters, like some of the Chinese glyphs your pasted, whereas the new one does.

PHP 5.4 is truly ancient. It was first released in 2012 and its very last version came out in September 3rd, 2015. As such, predating PCRE2 for more than two years, it uses the original PCRE version which does NOT properly support extended Unicode. PCRE2 was only added to PHP in PHP 7.0.

Which brings us back to your issue. We cannot reproduce it with any version of PHP 7. This tells us that the problem is not a bug in our code but rather the use of the very old PCRE in PHP 5.x versions. PHP 7 versions using PCRE2 work fine. Therefore, you just need to update the PHP version running on your site. There's nothing else anyone can do about it.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

lesprace
Thank you for your detailed explanation of the Bad words problem.

So we have a problem because the Joomla 2.5.x version is not compatible with the version of PHP 7 and the upgrade of the large site to Joomla 3.x or Joomla 4 is not quite simple, but that is our problem.

nicholas
Akeeba Staff
Manager
Ugh, you're stuck between a rock and a hard place. The only thing you could possibly do at this point is ask your host for assistance. They should have a server-side security solution, e.g. mod_security2 for Apache, which can be set up with rules to block suspicious requests. Per Google Translate some of the Chinese text is very clearly something you won't be ever legitimately using on your site (the word for "diploma" come to mind) so they should be able to create a rule to block requests containing it.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!