stop warning for lack of referer / user-agent - not having those is now pretty normal
This commit is contained in:
parent
c16e3fd939
commit
85662575c5
1 changed files with 3 additions and 12 deletions
|
@ -551,18 +551,9 @@ class CommentList extends Extension
|
|||
'website' => '',
|
||||
'body' => $text,
|
||||
'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'] = '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");
|
||||
}
|
||||
'referrer' => $_SERVER['HTTP_REFERER'] ?? 'none',
|
||||
'user_agent' => $_SERVER['HTTP_USER_AGENT'] ?? 'none',
|
||||
];
|
||||
|
||||
$akismet = new Akismet(
|
||||
$_SERVER['SERVER_NAME'],
|
||||
|
|
Reference in a new issue