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 |
|
|
--- perl-CGI-FormMagick-0.92/lib/CGI/FormMagick/Validator/Network.pm.ip-validation 2011-03-02 21:26:43.000000000 +0100 |
3 |
|
|
+++ perl-CGI-FormMagick-0.92/lib/CGI/FormMagick/Validator/Network.pm 2011-03-02 21:28:51.000000000 +0100 |
4 |
|
|
@@ -146,9 +146,9 @@ sub ip_number { |
5 |
|
|
|
6 |
|
|
return 'FM_IP_NUMBER1' unless $data =~ /^[\d.]+$/; |
7 |
|
|
|
8 |
|
|
- my @octets = split /\./, $data; |
9 |
|
|
+ my @dots = ($data =~ tr/.//); |
10 |
|
|
|
11 |
|
|
- return 'FM_IP_NUMBER2' unless scalar @octets == 4; |
12 |
|
|
+ return 'FM_IP_NUMBER2' unless scalar @dots == 3; |
13 |
|
|
|
14 |
|
|
foreach my $octet (@octets) { |
15 |
|
|
return $fm->localise("FM_IP_NUMBER3", {octet => $octet}) if $octet > 255; |