3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-24 03:29:28 +01:00

relay: convert / to . in hostnames on hybrid

Also, switch this check to a whitelist instead of a blacklist for better compatibility.

(cherry picked from commit 990f24938b)
This commit is contained in:
James Lu 2016-08-07 15:16:37 -07:00
parent 05bc7e292f
commit 8341667bdd

View File

@ -180,8 +180,8 @@ def normalizeNick(irc, netname, nick, times_tagged=0, uid=''):
def normalizeHost(irc, host): def normalizeHost(irc, host):
"""Creates a normalized hostname for the given host suitable for """Creates a normalized hostname for the given host suitable for
introduction to a remote network (as a relay client).""" introduction to a remote network (as a relay client)."""
if irc.protoname == 'unreal': if irc.protoname not in ('inspircd', 'ts6', 'clientbot', 'nefarious'):
# UnrealIRCd doesn't allow slashes in hostnames # UnrealIRCd and IRCd-Hybrid don't allow slashes in hostnames
host = host.replace('/', '.') host = host.replace('/', '.')
return host[:64] # Limited to 64 chars return host[:64] # Limited to 64 chars