Skip to:
Content

bbPress.org

Opened 4 weeks ago

Closed 3 weeks ago

Last modified 3 weeks ago

#3640 closed defect (bug) (fixed)

Words containing unicode chars may bypass moderation filters

Reported by: johnjamesjacoby's profile johnjamesjacoby Owned by: johnjamesjacoby's profile johnjamesjacoby
Milestone: 2.6.14 Priority: normal
Severity: normal Version: 2.0
Component: API - Moderation Keywords: commit
Cc:

Description

Related: #wp57207

See: https://bbpress.trac.wordpress.org/browser/trunk/src/includes/common/functions.php#L990

In short, words like "Установка" and "УСТАНОВКА" are only being matched in a case-sensitive way by the bbp_check_for_moderation() function.

It should be case-insensitive instead, so that it can correctly match & catch content regardless of upper or lower case.

Change History (2)

#1 @johnjamesjacoby
3 weeks ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 7303:

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.

#2 @johnjamesjacoby
3 weeks ago

In 7304:

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.

Note: See TracTickets for help on using tickets.