Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Email-Valid CPAN distribution.

Report information
The Basics
Id: 23657
Status: resolved
Priority: 0/
Queue: Email-Valid

People
Owner: Nobody in particular
Requestors: daydream.trippers [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: short domain label are reported invalid
Date: Mon, 27 Nov 2006 20:52:54 +0900
To: bug-Email-Valid [...] rt.cpan.org
From: "Nobuaki ITO" <daydream.trippers [...] gmail.com>
Dear Ricardo, Since version 0.177, strict fqdn rule is applied to inspection of email addresses. Show quoted text
> 0.177 Sat Nov 25 2006 > resolve bug 22710: make fqdn rule more strict: domains must be multiple > valid domain labels, and domain labels must be [a-z0-9][-a-z0-9]*
But regexp in subroutine '_is_domain_label' might not be correct. Show quoted text
> sub _is_domain_label { > my ($self, $string) = @_; > return unless $string =~ /\A > [A-Z0-9] # must start with an alnum > (?: > [-A-Z0-9]+ # then maybe a dash or alnum > [A-Z0-9] # finally ending with an alnum > )* # lather, rinse, repeat > \z/ix; > return 1; > }
With this regexp, domain labels which contain just two characters are not matched. For example, the 'rt' part of 'rt.cpan.org' doesn't conform the regexp. Possible code: sub _is_domain_label { my ($self, $string) = @_; return unless $string =~ /\A [A-Z0-9] # must start with an alnum (?: [-A-Z0-9]* # then maybe a dash or alnum [A-Z0-9] # finally ending with an alnum )? # lather, rinse \z/ix; return 1; } Regards. -- dayflower
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #23657] short domain label are reported invalid
Date: Mon, 27 Nov 2006 08:59:33 -0500
To: Nobuaki ITO via RT <bug-Email-Valid [...] rt.cpan.org>
From: Ricardo SIGNES <rjbs [...] cpan.org>
* Nobuaki ITO via RT <bug-Email-Valid@rt.cpan.org> [2006-11-27T06:53:26] Show quoted text
> > return unless $string =~ /\A > > [A-Z0-9] # must start with an alnum > > (?: > > [-A-Z0-9]+ # then maybe a dash or alnum > > [A-Z0-9] # finally ending with an alnum > > )* # lather, rinse, repeat > > \z/ix; > > return 1; > > }
> > With this regexp, domain labels which contain just two characters are > not matched. For example, the 'rt' part of 'rt.cpan.org' doesn't > conform the regexp.
Thank you for this quick catch! I will make an immediate release. -- rjbs
Fixed in release 0.179, as suggested by comment. The * following the (?:) group has been made a ?, since the internal * now suffices for arbitrary length. -- rjbs