Subject: | RFC 1101 |
Date: | Tue, 29 May 2007 05:26:18 -0700 (PDT) |
To: | bug-Validate-Net [...] rt.cpan.org |
From: | Matti Linnanvuori <mattilinnanvuori [...] yahoo.com> |
RFC 1101 updates RFC 1034 by allowing more domain sections.
The following is a patch to allow domain sections starting with a digit and containing two dashes:
Index: C:/Documents and Settings/malinnanvuori/My Documents/gbui/trunk/src/Gb/Ext/Validate/Net.pm
===================================================================
--- C:/Documents and Settings/malinnanvuori/My Documents/gbui/trunk/src/Gb/Ext/Validate/Net.pm (revision 1067)
+++ C:/Documents and Settings/malinnanvuori/My Documents/gbui/trunk/src/Gb/Ext/Validate/Net.pm (revision 7018)
@@ -119,23 +119,15 @@
return $self->withReason( "Domain section '$element' cannot be longer than 63 characters" );
}
- # Segments are allowed to contain only digits
- next if $element =~ /^\d+$/;
-
- # Segment must start with a letter
- if ( $element !~ /^[a-z]/ ) {
- return $self->withReason( "Domain section '$element' must start with a letter" );
+ # Segment must start with a letter or a digit
+ if ( $element !~ /^[a-z\d]/ ) {
+ return $self->withReason( "Domain section '$element' must start with a letter or number" );
}
# Segment must end with a letter or number
if ( $element !~ /[a-z0-9]$/ ) {
return $self->withReason( "Domain section '$element' must end with a letter or number" );
}
-
- # Cannot have two consecutive dashes ( RFC doesn't say so that I can find... is this correct? )
- if ( $element =~ /--/ ) {
- return $self->withReason( "Domain sections '$element' cannot have two dashes in a row" );
- }
}
return 1 if $self->{depth} eq 'fast';
Show quoted text
___________________________________________________________
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de