[wp-trac] [WordPress Trac] #19495: socialism is not spam
WordPress Trac
wp-trac at lists.automattic.com
Sat Dec 10 00:25:08 UTC 2011
#19495: socialism is not spam
-------------------------+-----------------------------
Reporter: mcargo | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords:
-------------------------+-----------------------------
Lots of WordPress sites I visit earn FYWP whenever a comment is
tagged a spam because it contains the word 'socialism', which has
the 'cialis' in it as a substring.
The relevant code is line 72 in
http://core.trac.wordpress.org/browser/trunk/wp-includes/comment.php
that is,
$pattern = "#$word#i";
In the code that follows, $pattern will match any of the search
strings when it is a case-insensitive substring of one of them.
Since preg_match is being used, this problem could be solved by
requiring that the match be at word boundaries, as
$pattern = "#\<$word\>#i";
(Of course, this means that things like 'IamSureYoudReallyLikeCialis'
would
make it through.)
I'm sure there are other, more efficient, ways to fix this.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/19495>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list