lib/askismet expects the referrer to either be set manually, or exist; if it doesn't exist we need to set it manually

This commit is contained in:
Shish 2012-01-19 15:20:32 +00:00
parent a75d8744c9
commit 7608107232

View File

@ -405,6 +405,13 @@ class CommentList extends SimpleExtension {
'permalink' => '',
);
# 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'] = '';
log_warning("comment", "User '{$user->name}' commented with no referrer: $text");
}
$akismet = new Akismet(
$_SERVER['SERVER_NAME'],
$config->get_string('comment_wordpress_key'),