Skip to content

Commit 5bbd80d

Browse files
authoredJul 1, 2022
Merge pull request from GHSA-ffmh-x56j-9rc3
(cherry picked from commit a3908cc082465000a3afa4bed47418b6e02c14ed)
1 parent 3d3c1fb commit 5bbd80d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed
 

‎src/additional/url2.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/core.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1416,7 +1416,7 @@ $.extend( $.validator, {
14161416
// https://gist.github.com/dperini/729294
14171417
// see also https://mathiasbynens.be/demo/url-regex
14181418
// modified to allow protocol-relative URLs
1419-
return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value );
1419+
return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})+(?::(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value );
14201420
},
14211421

14221422
// https://jqueryvalidation.org/date-method/

‎test/methods.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ QUnit.test( "url2 (tld optional)", function( assert ) {
123123
assert.ok( method( "http://www.føtex.dk/" ), "Valid url, danish unicode characters" );
124124
assert.ok( method( "http://bösendorfer.de/" ), "Valid url, german unicode characters" );
125125
assert.ok( method( "http://142.42.1.1" ), "Valid IP Address" );
126+
assert.ok( method( "http://bassistance" ), "Valid URL (optional TLD)" );
127+
assert.ok( method( "http://bassistance." ), "Valid URL (optional TLD)" );
126128
assert.ok( !method( "http://192.168.8." ), "Invalid IP Address" );
127-
assert.ok( method( "http://bassistance" ), "Invalid url" );
128-
assert.ok( method( "http://bassistance." ), "Invalid url" );
129129
assert.ok( !method( "http://bassistance,de" ), "Invalid url" );
130130
assert.ok( !method( "http://bassistance;de" ), "Invalid url" );
131131
assert.ok( !method( "http://.bassistancede" ), "Invalid url" );

0 commit comments

Comments
 (0)
Please sign in to comment.