From 7309947a74008dfc2f217d09d12aa0d1d76fb34e Mon Sep 17 00:00:00 2001 From: severak Date: Tue, 4 Feb 2020 11:46:18 +0100 Subject: [PATCH] Fixed bot detection. --- one.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/one.php b/one.php index 7749f0e..49acd40 100644 --- a/one.php +++ b/one.php @@ -21,7 +21,7 @@ try { $path = $_GET['path']; $width = $_GET['width']; $isUnique = !empty($_GET['unique']) ? 1 : 0; - $isBot = smart_ip_detect_crawler($ua); + $isBot = smart_ip_detect_crawler($ua) ? 1 : 0; $info = parse_user_agent($ua); $data[':site_id'] = $site['id']; @@ -39,7 +39,9 @@ try { echo 'OK'; } catch (Exception $exception) { - echo $exception->getMessage(); + if ($config['debug']) { + echo $exception->getMessage(); + } echo 'FAIL'; }