3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-01-24 03:04:05 +01:00

relay: whitelist _ on InspIRCd, UnrealIRCd, Nefarious, clientbot

This commit is contained in:
James Lu 2016-12-19 00:00:24 -08:00
parent ef8ec03e41
commit c09fce344d

View File

@ -182,6 +182,10 @@ def normalize_host(irc, host):
# UnrealIRCd and IRCd-Hybrid don't allow slashes in hostnames
allowed_chars += '/'
if irc.protoname in ('inspircd', 'clientbot', 'nefarious', 'unreal'):
# The above IRCds allow _ in hostnames, while TS6-like IRCds do not.
allowed_chars += '_'
for char in host:
if char not in allowed_chars:
host = host.replace(char, '-')