From 2f6699dd1c49b444de5c0d72dc9e20f4094accad Mon Sep 17 00:00:00 2001 From: Sascha Leib Date: Sun, 14 Sep 2025 19:48:09 +0200 Subject: [PATCH] Small touchups --- config/known-clients.json | 2 +- plugin.info.txt | 2 +- script.js | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/config/known-clients.json b/config/known-clients.json index f5bca20..67c535d 100644 --- a/config/known-clients.json +++ b/config/known-clients.json @@ -25,7 +25,7 @@ }, {"n": "Ecosia Browser", "id": "ecosia", - "rx": [ "\\(Ecosia ios@(\\d+)\\." ] + "rx": [ "\\(Ecosia \\w+@(\\d+)\\." ] }, {"n": "Silk", "id": "silk", diff --git a/plugin.info.txt b/plugin.info.txt index b2bf384..7f678bd 100644 --- a/plugin.info.txt +++ b/plugin.info.txt @@ -1,7 +1,7 @@ base botmon author Sascha Leib email ad@hominem.com -date 2025-09-13 +date 2025-09-14 name Bot Monitoring desc A tool for monitoring and analysing bot traffic to your wiki (under development) url https://www.dokuwiki.org/plugin:botmon diff --git a/script.js b/script.js index b6e1592..54465b5 100644 --- a/script.js +++ b/script.js @@ -95,7 +95,9 @@ const BotMon = { /* helper to convert an ip address string to a normalised format: */ _ip2Num: function(ip) { - if (ip.indexOf(':') > 0) { /* IP6 */ + if (!ip) { + return 'null'; + } else if (ip.indexOf(':') > 0) { /* IP6 */ return (ip.split(':').map(d => ('0000'+d).slice(-4) ).join('')); } else { /* IP4 */ return Number(ip.split('.').map(d => ('000'+d).slice(-3) ).join(''));