/[smeserver]/rpms/perl-CGI-FormMagick/sme8/perl-CGI-FormMagick-0.92-ip-validation.patch
ViewVC logotype

Diff of /rpms/perl-CGI-FormMagick/sme8/perl-CGI-FormMagick-0.92-ip-validation.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

Revision 1.1 by snetram, Wed Mar 2 20:44:52 2011 UTC Revision 1.2 by snetram, Sat Mar 5 08:53:08 2011 UTC
# Line 1  Line 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  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  --- 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-02 21:28:51.000000000 +0100  +++ perl-CGI-FormMagick-0.92/lib/CGI/FormMagick/Validator/Network.pm    2011-03-05 08:29:20.000000000 +0100
4  @@ -146,9 +146,9 @@ sub ip_number {  @@ -147,8 +147,9 @@ sub ip_number {
   
5       return 'FM_IP_NUMBER1' unless $data =~ /^[\d.]+$/;       return 'FM_IP_NUMBER1' unless $data =~ /^[\d.]+$/;
6    
7  -    my @octets = split /\./, $data;       my @octets = split /\./, $data;
8  +    my @dots = ($data =~ tr/.//);  +    my $dots = ($data =~ tr/.//);
9    
10  -    return 'FM_IP_NUMBER2' unless scalar @octets == 4;  -    return 'FM_IP_NUMBER2' unless scalar @octets == 4;
11  +    return 'FM_IP_NUMBER2' unless scalar @dots == 3;  +    return 'FM_IP_NUMBER2' unless (scalar @octets == 4 and $dots == 3);
12    
13       foreach my $octet (@octets) {       foreach my $octet (@octets) {
14           return $fm->localise("FM_IP_NUMBER3", {octet => $octet}) if $octet > 255;           return $fm->localise("FM_IP_NUMBER3", {octet => $octet}) if $octet > 255;


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed