don't crash if UA is empty

This commit is contained in:
Shish 2020-02-08 11:55:06 +00:00
parent 85cf801fb3
commit 2f975eb6d4

View File

@ -45,13 +45,14 @@ class Index extends Extension
try { try {
$fast_page_limit = 500; $fast_page_limit = 500;
$ua = $_SERVER["HTTP_USER_AGENT"] ?? "No UA";
if ( if (
SPEED_HAX SPEED_HAX
&& ( && (
strstr($_SERVER["HTTP_USER_AGENT"], "Googlebot") !== false strstr($ua, "Googlebot") !== false
|| strstr($_SERVER["HTTP_USER_AGENT"], "YandexBot") !== false || strstr($ua, "YandexBot") !== false
|| strstr($_SERVER["HTTP_USER_AGENT"], "bingbot") !== false || strstr($ua, "bingbot") !== false
|| strstr($_SERVER["HTTP_USER_AGENT"], "msnbot") !== false || strstr($ua, "msnbot") !== false
) )
&& ( && (
$count_search_terms > 1 $count_search_terms > 1