X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fp5-CGI-Ex;a=blobdiff_plain;f=lib%2FCGI%2FEx%2FValidate.pm;h=eadc98145fc84cf747c654f005c04d44d4b302c8;hp=f67a4baa368215838f97aa19d03111c2eab242c6;hb=ed00221d27dfab1e82ec2ea040ab4c399a91c545;hpb=0b04f67c06c1db11969096f07dfc7dbb23bf99ba diff --git a/lib/CGI/Ex/Validate.pm b/lib/CGI/Ex/Validate.pm index f67a4ba..eadc981 100644 --- a/lib/CGI/Ex/Validate.pm +++ b/lib/CGI/Ex/Validate.pm @@ -22,7 +22,7 @@ use vars qw($VERSION @UNSUPPORTED_BROWSERS ); -$VERSION = '2.23'; +$VERSION = '2.24'; $DEFAULT_EXT = 'val'; $QR_EXTRA = qr/^(\w+_error|as_(array|string|hash)_\w+|no_\w+)/; @@ -661,13 +661,7 @@ sub check_type { return 0 if $value =~ m/(\.\-|\-\.|\.\.)/; return 0 if length($value) > 255; return 0 if $value !~ s/\.([a-z]+)$//; - - my $ext = $1; - if ($ext eq 'name') { # .name domains - return 0 if $value !~ /^[a-z0-9][a-z0-9\-]{0,62} \. [a-z0-9][a-z0-9\-]{0,62}$/x; - } else { # any other domains - return 0 if $value !~ /^([a-z0-9][a-z0-9\-]{0,62} \.)* [a-z0-9][a-z0-9\-]{0,62}$/x; - } + return 0 if $value !~ /^([a-z0-9][a-z0-9\-]{0,62} \.)* [a-z0-9][a-z0-9\-]{0,62}$/x; ### validate a url } elsif ($type eq 'URL') {