We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5682129 + 2ae02cf commit 1d7c5b9Copy full SHA for 1d7c5b9
urns/urns.go
@@ -78,7 +78,7 @@ func IsValidScheme(scheme string) bool {
78
}
79
80
var nonTelCharsRegex = regexp.MustCompile(`[^0-9a-z]`)
81
-var telRegex = regexp.MustCompile(`^\+?[a-zA-Z0-9]{3,64}$`)
+var telRegex = regexp.MustCompile(`^\+?[a-zA-Z0-9]{1,64}$`)
82
var twitterHandleRegex = regexp.MustCompile(`^[a-zA-Z0-9_]{1,15}$`)
83
var emailRegex = regexp.MustCompile(`^[^\s@]+@[^\s@]+$`)
84
var viberRegex = regexp.MustCompile(`^[a-zA-Z0-9_=/+]{1,24}$`)
urns/urns_test.go
@@ -206,12 +206,13 @@ func TestValidate(t *testing.T) {
206
{"tel:+250788383383", ""},
207
{"tel:+250123", ""},
208
{"tel:1337", ""},
209
+ {"tel:1", ""}, // one digit shortcodes are a thing
210
{"tel:PRIZES", ""},
211
{"tel:cellbroadcastchannel50", ""},
212
213
// invalid tel numbers
214
{"tel:07883 83383", "invalid tel number"}, // can't have spaces
- {"tel:12", "invalid tel number"}, // too short
215
+ {"tel:", "cannot be empty"}, // need a path
216
217
// twitter handles
218
{"twitter:jimmyjo", ""},
@@ -301,7 +302,7 @@ func TestTelURNs(t *testing.T) {
301
302
{"0788383383", "ZZ", "tel:0788383383", false},
303
{"PRIZES", "RW", "tel:prizes", false},
304
{"PRIZES!", "RW", "tel:prizes", false},
- {"1", "RW", "", true},
305
+ {"1", "RW", "tel:1", false},
306
{"123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", "RW", "", true},
307
308
0 commit comments