From 8ba22d8fbcf1434fbef81d21cec6bdecc2e5aae1 Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 19 Jan 2012 15:28:55 +0000 Subject: [PATCH] same for user-agent --- ext/comment/main.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/comment/main.php b/ext/comment/main.php index 0c54ad06..6f082a76 100644 --- a/ext/comment/main.php +++ b/ext/comment/main.php @@ -408,9 +408,13 @@ class CommentList extends SimpleExtension { # akismet breaks if there's no referrer in the environment; so if there # isn't, supply one manually if(!isset($_SERVER['HTTP_REFERER'])) { - $comment['referrer'] = ''; + $comment['referrer'] = 'none'; log_warning("comment", "User '{$user->name}' commented with no referrer: $text"); } + if(!isset($_SERVER['HTTP_USER_AGENT'])) { + $comment['user_agent'] = 'none'; + log_warning("comment", "User '{$user->name}' commented with no user-agent: $text"); + } $akismet = new Akismet( $_SERVER['SERVER_NAME'],