logo

auto_linker

AutoLinker-shim, based on https://git.pleroma.social/pleroma/auto_linker
commit: d748890d1e488c654855034c5d2eb75b4a9eb21a
parent: 2d036b2aab921d394c169f93af5950e6414c5160
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Wed, 27 Feb 2019 04:42:48 +0100

AutoLinker.Parser: Remove @match_hostname and @match_ip

Diffstat:

Mlib/auto_linker/parser.ex7++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/lib/auto_linker/parser.ex b/lib/auto_linker/parser.ex @@ -29,10 +29,6 @@ defmodule AutoLinker.Parser do @match_phone ~r"((?:x\d{2,7})|(?:(?:\+?1\s?(?:[.-]\s?)?)?(?:\(\s?(?:[2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s?\)|(?:[2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s?(?:[.-]\s?)?)(?:[2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s?(?:[.-]\s?)?(?:[0-9]{4}))" - @match_hostname ~r{^(?:https?:\/\/)?(?:[^@\n]+\\w@)?(?<host>[^:#~\/\n?]+)} - - @match_ip ~r"^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$" - # @user # @user@example.com # credo:disable-for-next-line @@ -283,8 +279,9 @@ defmodule AutoLinker.Parser do is_url?(buffer) and Regex.match?(@valid_email, buffer) end + # Shimming def is_ip?(buffer) do - Regex.match?(@match_ip, buffer) + true end @doc false