File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -25,12 +25,12 @@ export default function isFQDN(str, options) {
2525 return false ;
2626 }
2727
28- if ( ! / ^ ( [ a - z \u00a1 - \uffff ] { 2 , } | x n [ a - z 0 - 9 - ] { 2 , } ) $ / i. test ( tld ) ) {
28+ if ( ! / ^ ( [ a - z \u00A1 - \u00A8 \u00AA - \uD7FF \uF900 - \uFDCF \uFDF0 - \uFFEF ] { 2 , } | x n [ a - z 0 - 9 - ] { 2 , } ) $ / i. test ( tld ) ) {
2929 return false ;
3030 }
3131
32- // disallow spaces && special characers
33- if ( / [ \s \u2002 - \u200B \u202F \u205F \u3000 \uFEFF \uDB40 \uDC20 \u00A9 \uFFFD ] / . test ( tld ) ) {
32+ // disallow spaces
33+ if ( / \s / . test ( tld ) ) {
3434 return false ;
3535 }
3636 }
Original file line number Diff line number Diff line change @@ -1074,6 +1074,18 @@ describe('Validators', () => {
10741074 'domain.com/' ,
10751075 '/more.com' ,
10761076 'domain.com�' ,
1077+ 'domain.co\u00A0m' ,
1078+ 'domain.co\u1680m' ,
1079+ 'domain.co\u2006m' ,
1080+ 'domain.co\u2028m' ,
1081+ 'domain.co\u2029m' ,
1082+ 'domain.co\u202Fm' ,
1083+ 'domain.co\u205Fm' ,
1084+ 'domain.co\u3000m' ,
1085+ 'domain.com\uDC00' ,
1086+ 'domain.co\uEFFFm' ,
1087+ 'domain.co\uFDDAm' ,
1088+ 'domain.co\uFFF4m' ,
10771089 'domain.com©' ,
10781090 'example.0' ,
10791091 '192.168.0.9999' ,
You can’t perform that action at this time.
0 commit comments