Remove IP addresses from "sneaky" link detection
This commit is contained in:
parent
63b2644cb4
commit
693deaebe8
2 changed files with 13 additions and 21 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue