• Resolved n0dyjeff

    (@n0dyjeff)


    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?

    https://www.ads-software.com/plugins/wp-fail2ban/

Viewing 1 replies (of 1 total)
  • Plugin Author invisnet

    (@invisnet)

    No, you’re quite correct – it was a stupid mistake on my part.

    Should be fixed in 2.2.1, just released.

Viewing 1 replies (of 1 total)
  • The topic ‘Error using WP_FAIL2BAN_BLOCKED_USERS’ is closed to new replies.