From: Michael S Collins Date: Fri, 19 Nov 2010 19:42:15 +0000 (-0800) Subject: Strip whitespace from IP addresses in blacklist X-Git-Tag: v1.2-rc1~265^2~4^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c74573cb16f8892666f16d36dbdc1fe1c5ef7c46;p=thirdparty%2Ffreeswitch.git Strip whitespace from IP addresses in blacklist --- 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";