1 |
diff -up perl-CGI-FormMagick-0.92/lib/CGI/FormMagick/Validator/Network.pm.ip-validation perl-CGI-FormMagick-0.92/lib/CGI/FormMagick/Validator/Network.pm |
2 |
--- perl-CGI-FormMagick-0.92/lib/CGI/FormMagick/Validator/Network.pm.ip-validation 2011-03-05 08:27:07.000000000 +0100 |
3 |
+++ perl-CGI-FormMagick-0.92/lib/CGI/FormMagick/Validator/Network.pm 2011-03-05 08:29:20.000000000 +0100 |
4 |
@@ -147,8 +147,9 @@ sub ip_number { |
5 |
return 'FM_IP_NUMBER1' unless $data =~ /^[\d.]+$/; |
6 |
|
7 |
my @octets = split /\./, $data; |
8 |
+ my $dots = ($data =~ tr/.//); |
9 |
|
10 |
- return 'FM_IP_NUMBER2' unless scalar @octets == 4; |
11 |
+ return 'FM_IP_NUMBER2' unless (scalar @octets == 4 and $dots == 3); |
12 |
|
13 |
foreach my $octet (@octets) { |
14 |
return $fm->localise("FM_IP_NUMBER3", {octet => $octet}) if $octet > 255; |