diff --git a/urns/urns.go b/urns/urns.go index 1025bd1..64d4dc8 100644 --- a/urns/urns.go +++ b/urns/urns.go @@ -78,7 +78,7 @@ func IsValidScheme(scheme string) bool { } var nonTelCharsRegex = regexp.MustCompile(`[^0-9a-z]`) -var telRegex = regexp.MustCompile(`^\+?[a-zA-Z0-9]{3,16}$`) +var telRegex = regexp.MustCompile(`^\+?[a-zA-Z0-9]{3,64}$`) var twitterHandleRegex = regexp.MustCompile(`^[a-zA-Z0-9_]{1,15}$`) var emailRegex = regexp.MustCompile(`^[^\s@]+@[^\s@]+$`) var viberRegex = regexp.MustCompile(`^[a-zA-Z0-9_=/+]{1,24}$`) diff --git a/urns/urns_test.go b/urns/urns_test.go index 4c89fb9..0d3a303 100644 --- a/urns/urns_test.go +++ b/urns/urns_test.go @@ -207,11 +207,11 @@ func TestValidate(t *testing.T) { {"tel:+250123", ""}, {"tel:1337", ""}, {"tel:PRIZES", ""}, + {"tel:cellbroadcastchannel50", ""}, // invalid tel numbers - {"tel:07883 83383", "invalid tel number"}, // can't have spaces - {"tel:12", "invalid tel number"}, // too short - {"tel:12345678901234567", "invalid tel number"}, // too long + {"tel:07883 83383", "invalid tel number"}, // can't have spaces + {"tel:12", "invalid tel number"}, // too short // twitter handles {"twitter:jimmyjo", ""}, @@ -302,7 +302,7 @@ func TestTelURNs(t *testing.T) { {"PRIZES", "RW", "tel:prizes", false}, {"PRIZES!", "RW", "tel:prizes", false}, {"1", "RW", "", true}, - {"123456789012345678901234567890", "RW", "", true}, + {"123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", "RW", "", true}, } for _, tc := range testCases {