Update list of bot UAs
This commit is contained in:
parent
ec3214d1f9
commit
892878313a
2523
lib/bots.json
2523
lib/bots.json
File diff suppressed because it is too large
Load Diff
4552
lib/crawler-user-agents.json
Normal file
4552
lib/crawler-user-agents.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -21,7 +21,7 @@ if (!$database->has("settings", ["AND" => ["siteid" => getsiteid(), "key" => "an
|
||||
throw new Exception("Do-Not-Track header detected, skipping analytics");
|
||||
}
|
||||
|
||||
$bots = json_decode(file_get_contents(__DIR__ . "/bots.json"), true);
|
||||
$bots = json_decode(file_get_contents(__DIR__ . "/crawler-user-agents.json"), true);
|
||||
foreach ($bots as $bot) {
|
||||
if (preg_match('/' . $bot['pattern'] . '/', $_SERVER['HTTP_USER_AGENT'])) {
|
||||
throw new Exception("Bot/crawler detected, skipping analytics");
|
||||
|
Loading…
x
Reference in New Issue
Block a user