[wp-hackers] Why is Akismet returning more info in the $commentdata ?
Peter van der Does
peter at avirtualhome.com
Sat Dec 19 05:24:24 UTC 2009
On Sat, 19 Dec 2009 00:06:04 -0500
Doug Stewart <zamoose at gmail.com> wrote:
> On Fri, Dec 18, 2009 at 11:31 PM, Peter van der Does
> <peter at avirtualhome.com
> > wrote:
>
> > Akismet is adding several fields to commentdata during the
> > preprocess_comment filter. The function called is
> > akismet_auto_check_comment.
> >
> > The following fields are added:
> >
> > $comment['user_ip'] = preg_replace( '/[^0-9., ]/', '',
> > $_SERVER['REMOTE_ADDR'] );
> > $comment['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
> > $comment['referrer'] = $_SERVER['HTTP_REFERER'];
> > $comment['blog'] = get_option('home');
> > $comment['blog_lang'] = get_locale();
> > $comment['blog_charset'] = get_option('blog_charset');
> > $comment['permalink'] = get_permalink($comment['comment_post_ID']);
> >
> >
> > Why is this?
> >
> >
> ...Because all those pieces of information are useful in determining
> potential spam?
>
> If someone is leaving Cyrillic-encoded comments on a blog using the
> English (US) locale, there's a good chance it's spam, for instance.
>
> At least that's my read on it. Each of those pieces of info could be
> quite useful in determining in a heuristic/holistic fashion the
> chance that a spammer is doing the commenting.
>
But why are the returned into WordPress?
The next function called with the preprocess_comment filter inherits
all these fields as well.
It just seems unnecessary.
--
Peter van der Does
GPG key: E77E8E98
IRC: Ganseki on irc.freenode.net
Twitter: @petervanderdoes
WordPress Plugin Developer
Blog: http://blog.avirtualhome.com
Forums: http://forums.avirtualhome.com
Twitter: @avhsoftware
More information about the wp-hackers
mailing list