Skip to:
Content

bbPress.org

Changeset 7303


Ignore:
Timestamp:
06/25/2025 12:40:13 AM (2 months ago)
Author:
johnjamesjacoby
Message:

Moderation: Make moderated or disallowed key check case-insensitive for non-Latin words.

The bbp_check_for_moderation() function expects to be case-insensitive, but that only works for words using Latin script and consisting of ASCII characters.

This commit adds the Unicode flag to the regular expression used for the check in these functions, so that both pattern and subject can be treated as UTF-8 strings.

See: https://www.php.net/manual/en/reference.pcre.pattern.modifiers.php

In trunk, for 2.7.

Fixes #3640.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/common/functions.php

    r7302 r7303  
    988988        // spam words don't break things:
    989989        $word    = preg_quote( $word, '#' );
    990         $pattern = "#{$word}#i";
     990        $pattern = "#{$word}#iu";
    991991
    992992        // Loop through post data
Note: See TracChangeset for help on using the changeset viewer.