mirror of
https://github.com/progval/Limnoria.git
synced 2025-04-30 07:21:10 -05:00
conf: fix validation of multiple IP addresses
Previously, setting supybot.servers.http.hosts6 to multiple IP addresses always failed because utils.net.isIPV6() gets passed a string with a space in it. This code worked however for multiple IPv4 addresses because inet_aton(), which is used internally by isIPV4(), allows and ignores trailing data after the first IP address it finds. Thanks to @MrBenC for reporting.
This commit is contained in:
parent
e05f1ae5df
commit
ebb48a4808
@ -1241,7 +1241,7 @@ registerGroup(supybot.servers, 'http')
|
|||||||
class IP(registry.String):
|
class IP(registry.String):
|
||||||
"""Value must be a valid IP."""
|
"""Value must be a valid IP."""
|
||||||
def setValue(self, v):
|
def setValue(self, v):
|
||||||
if v and not utils.net.isIP(v):
|
if v and not all(map(utils.net.isIP, v.split())):
|
||||||
self.error()
|
self.error()
|
||||||
else:
|
else:
|
||||||
registry.String.setValue(self, v)
|
registry.String.setValue(self, v)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user