Skip to content

Commit d36a1b1

Browse files
authored
Merge pull request #182 from ChALkeR/chalker/fix-comma
Fix uri scheme validation
2 parents 5389c5b + b6ea484 commit d36a1b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

formats.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ exports['time'] = /^\d{2}:\d{2}:\d{2}$/
1313
exports['email'] = function (input) { return (input.indexOf('@') !== -1) && (!reEmailWhitespace.test(input)) }
1414
exports['ip-address'] = exports['ipv4'] = createIpValidator({ version: 4 })
1515
exports['ipv6'] = createIpValidator({ version: 6 })
16-
exports['uri'] = /^[a-zA-Z][a-zA-Z0-9+-.]*:[^\s]*$/
16+
exports['uri'] = /^[a-zA-Z][a-zA-Z0-9+\-.]*:[^\s]*$/
1717
exports['color'] = /(#?([0-9A-Fa-f]{3,6})\b)|(aqua)|(black)|(blue)|(fuchsia)|(gray)|(green)|(lime)|(maroon)|(navy)|(olive)|(orange)|(purple)|(red)|(silver)|(teal)|(white)|(yellow)|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\))/
1818
exports['hostname'] = function (input) {
1919
if (!(reHostnameFirstPass.test(input))) return false

0 commit comments

Comments
 (0)