Skip Menu |
 

This queue is for tickets about the Mail-CheckUser CPAN distribution.

Report information
The Basics
Id: 1838
Status: resolved
Priority: 0/
Queue: Mail-CheckUser

People
Owner: Nobody in particular
Requestors: rpb [...] hybte.com
Cc:
AdminCc:

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



Subject: Regexp error
Download (untitled) / with headers
text/plain 1.4k
Mail-CheckUser-1.16 This is perl, v5.8.0 built for i586-linux Linux rodger-linux 2.4.7-10 #1 Thu Sep 6 17:21:28 EDT 2001 i586 unknown The REs for name and host don't work. Valid email addresses were rejected with 'bad username syntax'. I suggest replacing the RE code with (sorry, not a patch) - # build hostname regexp # NOTE: it doesn't strictly follow RFC822 # because of what registrars now allow. my $DOMAIN_RE = qr/(?:[\da-zA-Z]+ -+)* [\da-zA-Z]+/x; my $HOSTNAME_RE = qr/^ (?:$DOMAIN_RE \.)+ [a-zA-Z]+ $/x; sub check_hostname_syntax($) { my($hostname) = @_; _pm_log "check_hostname_syntax: checking \"$hostname\""; # check if hostname syntax is correct if($hostname =~ $HOSTNAME_RE) { return _result(CU_OK, 'correct hostname syntax'); } else { return _result(CU_BAD_SYNTAX, 'bad hostname syntax'); } } # build username regexp # NOTE: it doesn't strictly follow RFC821 my $STRING_RE = ('[' . quotemeta(join '', grep(!/[<>()\[\]\\\.,;:\@"]/, # ["], UnBug Emacs map chr, 33 .. 126)) . ']'); my $USERNAME_RE = qr/^ (?:$STRING_RE+ \.)* $STRING_RE+ $/x; sub check_username_syntax($) { my($username) = @_; _pm_log "check_username_syntax: checking \"$username\""; # check if username syntax is correct if($username =~ $USERNAME_RE) { return _result(CU_OK, 'correct username syntax'); } else { return _result(CU_BAD_SYNTAX, 'bad username syntax'); } }


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.