From cf24c59e1d390db39b305b1aec7a17d3b0551b0f Mon Sep 17 00:00:00 2001 From: Terrtia Date: Mon, 10 Feb 2020 10:44:06 +0100 Subject: [PATCH] fix: [IPAdress] remove leading zeros #465 --- bin/IPAddress.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/IPAddress.py b/bin/IPAddress.py index e45a4ce6..e2ed59cf 100755 --- a/bin/IPAddress.py +++ b/bin/IPAddress.py @@ -32,8 +32,9 @@ def search_ip(message): results = reg_ip.findall(content) matching_ips = [] - for res in results: - address = IPv4Address(res) + for ip in results: + ip = '.'.join([str(int(x)) for x in ip.split('.')]) + address = IPv4Address(ip) for network in ip_networks: if address in network: matching_ips.append(address)