Remove IP addresses from "sneaky" link detection
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
/* global URL */
|
||||
|
||||
const { isNumber, compact, isEmpty } = require('lodash');
|
||||
const { isIP } = require('net');
|
||||
const nodeUrl = require('url');
|
||||
const LinkifyIt = require('linkify-it');
|
||||
|
||||
@@ -99,11 +98,6 @@ function isLinkSneaky(link) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Domain cannot be an IP address.
|
||||
if (isIP(domain)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// There must be at least 2 domain labels, and none of them can be empty.
|
||||
const labels = domain.split('.');
|
||||
if (labels.length < 2 || labels.some(isEmpty)) {
|
||||
|
Reference in New Issue
Block a user