[wp-trac] [WordPress Trac] #57207: Consider adding the Unicode regex flag in wp_check_comment_disallowed_list

WordPress Trac noreply at wordpress.org
Mon Nov 28 19:43:14 UTC 2022


#57207: Consider adding the Unicode regex flag in wp_check_comment_disallowed_list
-------------------------+-----------------------------
 Reporter:  bonjour52    |       Owner:  SergeyBiryukov
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:  6.2
Component:  Comments     |     Version:
 Severity:  normal       |  Resolution:  fixed
 Keywords:  has-patch    |     Focuses:
-------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * status:  accepted => closed
 * resolution:   => fixed


Comment:

 In [changeset:"54888" 54888]:
 {{{
 #!CommitTicketReference repository="" revision="54888"
 Comments: Make moderated or disallowed key check case-insensitive for non-
 Latin words.

 The `check_comment()` and `wp_check_comment_disallowed_list()` functions
 are expected to be case-insensitive, but that only worked 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.

 Reference:
 [https://www.php.net/manual/en/reference.pcre.pattern.modifiers.php PHP
 Manual: Pattern Modifiers].

 Follow-up to [984], [2075], [48121], [48575].

 Props bonjour52, SergeyBiryukov.
 Fixes #57207.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57207#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list