From a59b3a84d2ab4bc507f5b41329b46a56dc631938 Mon Sep 17 00:00:00 2001 From: OFF0 Date: Tue, 20 Dec 2022 22:19:42 +0100 Subject: [PATCH] content: exclude links to ip addresses There is no good reason to link to an ip directly. --- src/domutil.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/domutil.js b/src/domutil.js index bbfe9e1..15d23bc 100644 --- a/src/domutil.js +++ b/src/domutil.js @@ -35,6 +35,9 @@ function isValidURL(url) { if (lastDot < 1) { return false; } + if (url.hostname.slice(lastDot + 1).match(/^[\d]+$/)) { + return false; + } if (url.hostname.slice(lastDot) === '.local') { return false; }