From c74573cb16f8892666f16d36dbdc1fe1c5ef7c46 Mon Sep 17 00:00:00 2001 From: Michael S Collins Date: Fri, 19 Nov 2010 11:42:15 -0800 Subject: [PATCH] Strip whitespace from IP addresses in blacklist --- scripts/perl/blacklist.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/perl/blacklist.pl b/scripts/perl/blacklist.pl index 92fa55efe2..a2834b62bf 100755 --- a/scripts/perl/blacklist.pl +++ b/scripts/perl/blacklist.pl @@ -17,7 +17,8 @@ my @netblocks = split(/\n/, get("http://www.infiltrated.net/voipabuse/netblocks. print "\n"; foreach $addr (@addresses) { - next unless $addr =~ m/\d+\.\d+\.\d+\.\d+/; + $addr =~ s/\s//g; # strip whitespace + next unless $addr =~ m/\d+\.\d+\.\d+\.\d+/; # imperfect but useful IP addr check print " \n"; } print "\n"; @@ -25,7 +26,8 @@ print "\n"; print "\n"; foreach $netb (@netblocks) { - next unless $netb =~ m/\d+\.\d+\.\d+\.\d+/; + $netb =~ s/\s//g; # strip whitespace + next unless $netb =~ m/\d+\.\d+\.\d+\.\d+/; # imperfect but useful IP addr check print " \n"; } print "\n";