Skip to:
Content

bbPress.org

Changeset 7304


Ignore:
Timestamp:
06/25/2025 12:40:48 AM (5 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 branches/2.6, for 2.6.14.

Fixes #3640.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.6/src/includes/common/functions.php

    r7301 r7304  
    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.