summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDom Rodriguez <shymega@shymega.org.uk>2017-04-18 22:47:32 +0200
committerDom Rodriguez <shymega@shymega.org.uk>2017-04-18 22:47:32 +0200
commit1bc0b63b227bfb068230134cc27a943befe364f5 (patch)
tree67ef459a7b4aa015ea13816207dc07c817f663fe
parentMerge pull request #61 from w1gz/avoid-latin1-charset (diff)
Fix IRC regex handling of slashes in host
As per the issue reported in #59, this commit fixes that issue with a regex patch suggested by @vktec. This commit has been tested with cloaks, and _appears_ to work, which is a good improvement. Because of the improvement, this fixes #59.
-rw-r--r--lib/exirc/utils.ex2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/exirc/utils.ex b/lib/exirc/utils.ex
index b2a79cd..e9c0c35 100644
--- a/lib/exirc/utils.ex
+++ b/lib/exirc/utils.ex
@@ -25,7 +25,7 @@ defmodule ExIrc.Utils do
end
end
- @prefix_pattern ~r/^(?<nick>[^!]+)(?:!(?:(?<user>[^@ ]+)@)?(?:(?<host>[\w.:-]+)))?$/
+ @prefix_pattern ~r/^(?<nick>[^!]+)(?:!(?:(?<user>[^@ ]+)@)?(?:(?<host>\S+[\w.:-]+)))?$/
defp parse_from(from, msg) do
from_str = IO.iodata_to_binary(from)
parts = Regex.run(@prefix_pattern, from_str, capture: :all_but_first)