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:
parent
05bc7e292f
commit
8341667bdd
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user