Error using WP_FAIL2BAN_BLOCKED_USERS
-
With the latest release of wp-fail2ban (2.2.0), I found I wasn’t able to use WP_FAIL2BAN_BLOCKED_USERS with a regex for a specific username. E.g.
define('WP_FAIL2BAN_BLOCKED_USERS','^admin$');
didn’t work.Looking into the code, I see that the problem is in the test for the definition of WP_FAIL2BAN_BLOCKED_USERS. The original code:
if (defined('WP_FAIL2BAN_BLOCKED_USERS') && true === WP_FAIL2BAN_BLOCKED_USERS)
wants to see if the string ‘WP_FAIL2BAN_BLOCKED_USERS’ is identical to the Boolean true (which it is not).
The following code meets the intent (allows WP_FAIL2BAN_BLOCKED_USERS to be turned off by defining it false), and also allows the regex to work:
if (defined('WP_FAIL2BAN_BLOCKED_USERS') && false !== WP_FAIL2BAN_BLOCKED_USERS)
Or perhaps I’m missing something?
- The topic ‘Error using WP_FAIL2BAN_BLOCKED_USERS’ is closed to new replies.