From 72a877d9cabf1ed684d7f80d94ccdbfeef7edf91 Mon Sep 17 00:00:00 2001 From: slawkens Date: Fri, 17 Feb 2023 19:06:13 +0100 Subject: [PATCH] Show more info about bot --- admin/pages/visitors.php | 5 ++++- system/templates/admin.visitors.html.twig | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/admin/pages/visitors.php b/admin/pages/visitors.php index 02cd372c..77626eb0 100644 --- a/admin/pages/visitors.php +++ b/admin/pages/visitors.php @@ -43,8 +43,11 @@ foreach ($tmp as &$visitor) { else { $dd = new DeviceDetector($userAgent); $dd->parse(); + if ($dd->isBot()) { - $browser = '(Bot) ' . $dd->getBot(); + $bot = $dd->getBot(); + $message = '(Bot) %s, %s'; + $browser = sprintf($message, $bot['category'], $bot['url'], $bot['name']); } else { $osFamily = OperatingSystem::getOsFamily($dd->getOs('name')); diff --git a/system/templates/admin.visitors.html.twig b/system/templates/admin.visitors.html.twig index f71c3b31..64a06ef3 100644 --- a/system/templates/admin.visitors.html.twig +++ b/system/templates/admin.visitors.html.twig @@ -18,7 +18,7 @@ {{ visitor.ip }} {{ visitor.lastvisit|date("H:i:s") }} {{ visitor.page|slice(0, 50) }} - {{ visitor.browser }} + {{ visitor.browser|raw }} {% endfor %}