[wp-trac] [WordPress Trac] #2798: Error while checking for blacklisted words

WordPress Trac wp-trac at lists.automattic.com
Wed Jun 7 21:08:30 GMT 2006


#2798: Error while checking for blacklisted words
----------------------------+-----------------------------------------------
       Id:  2798            |      Status:  new                     
Component:  Administration  |    Modified:  Wed Jun  7 21:08:30 2006
 Severity:  major           |   Milestone:                          
 Priority:  normal          |     Version:  2.0.2                   
    Owner:  anonymous       |    Reporter:  prokurator              
----------------------------+-----------------------------------------------
 As everyone knows how regular expression work funktion wp_blacklist_check
 will block any comment with the word 'specialist' if blacklist contains
 word 'cialis'.

 This can be easily fixed by adding word boundaries around word from
 blacklist while constructing the pattern.

 Here is the solution:

 instead of line 666 (WP202) in wp-inclides/functions-post.php
 $pattern = "#$word#i";
 use this:
 $pattern = "#\b$word\b#i";

 This will let comment with word 'specialist' through and stop comment with
 word 'cialis'.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/2798>
WordPress Trac <http://wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list