1 |
snetram |
1.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 |
snetram |
1.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 |
snetram |
1.1 |
return 'FM_IP_NUMBER1' unless $data =~ /^[\d.]+$/; |
6 |
|
|
|
7 |
snetram |
1.2 |
my @octets = split /\./, $data; |
8 |
|
|
+ my $dots = ($data =~ tr/.//); |
9 |
snetram |
1.1 |
|
10 |
|
|
- return 'FM_IP_NUMBER2' unless scalar @octets == 4; |
11 |
snetram |
1.2 |
+ return 'FM_IP_NUMBER2' unless (scalar @octets == 4 and $dots == 3); |
12 |
snetram |
1.1 |
|
13 |
|
|
foreach my $octet (@octets) { |
14 |
|
|
return $fm->localise("FM_IP_NUMBER3", {octet => $octet}) if $octet > 255; |