Modify ↓
Ticket #1676 (closed defect: fixed)
deal with non-ascii chars on hostname fields
| Reported by: | jsalamero@… | Owned by: | jacalvo@… |
|---|---|---|---|
| Milestone: | 2.0.X | Component: | base |
| Severity: | normal | Keywords: | |
| Cc: |
Description
hostname fields shouldn't permit non-ascii fields or deal with them somehow.
Attachments
Change History
comment:1 Changed 3 years ago by jacalvo@…
- Owner changed from javier.amor.garcia@… to jacalvo@…
- Milestone changed from nice to have someday to 2.0.X
comment:2 Changed 3 years ago by jacalvo@…
- Status changed from new to assigned
Currently this check is done with:
sub _checkDomainName {
my $d = shift;
($d =~ /^\w/) or return undef;
($d =~ /\w$/) or return undef;
($d =~ /\.-/) and return undef;
($d =~ /-\./) and return undef;
($d =~ /\.\./) and return undef;
($d =~ /_/) and return undef;
($d =~ /^[-\.\w]+$/) or return undef;
return 1;
}
Maybe we should replace that with libdata-validate-domain-perl:
use Data::Validate::Domain qw(is_domain);
is_domain($foo)
Note: See
TracTickets for help on using
tickets.