From 3a4cd948d18cd157f9b743b80735335a5cf852e7 Mon Sep 17 00:00:00 2001
From: Kieran Brahney
Date: Thu, 19 May 2022 16:41:29 +0100
Subject: [PATCH 01/38] Build: Updating the master version to 1.19.5-pre.
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index e33dea196..0bc214db1 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "jquery-validation",
"title": "jQuery Validation Plugin",
"description": "Client-side form validation made easy",
- "version": "1.19.4-pre",
+ "version": "1.19.5-pre",
"homepage": "https://jqueryvalidation.org/",
"license": "MIT",
"author": {
From b68e282cc4e4e1bc34805f9f2383562e3c4dcc4b Mon Sep 17 00:00:00 2001
From: Kieran Brahney
Date: Thu, 19 May 2022 16:53:14 +0100
Subject: [PATCH 02/38] Chore: update changelog
---
changelog.md | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/changelog.md b/changelog.md
index 9f23f9b1b..284e5a15c 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,3 +1,22 @@
+1.19.4 / 2022-05-19
+===================
+
+## Build
+ * Add License.md to zip tarball (#2386)
+
+## Chore
+ * Updated build status badges (#2424)
+ * Enabled stable bot (#2425)
+
+## Core
+ * Fixed validation for input type="date" (#2360)
+ * Wait for pendingRequests to finish before submitting form (#2369)
+ * Fixed bug for Html Editors (#2154) (#2422)
+ * Fixed ReDoS vulnerability in URL2 validation (#2428)
+
+## Test
+ * Switch from Travis to GitHub workflows (#2423)
+
1.19.3 / 2021-01-09
===================
From 1b79877af768ceaa0901dbcbda366bb27124989b Mon Sep 17 00:00:00 2001
From: EricDunsworth <1907279+EricDunsworth@users.noreply.github.com>
Date: Mon, 23 May 2022 06:50:05 -0400
Subject: [PATCH 03/38] Localization: Add periods to messages (#2266)
All core messages end with periods. But additional/localization messages were
previously using them inconsistently.
This commit adds message periods to:
* Additional files that lacked them
* Localization files that were already mostly using them
* Italian (it) localization file
Didn't add any periods to non-Latin localization files that previously weren't
using them at all (AR, bn_BD, he, hy_AM, sd, th, ur, zh and zh_TW).
---
src/additional/alphanumeric.js | 2 +-
src/additional/bankaccountNL.js | 2 +-
src/additional/bankorgiroaccountNL.js | 2 +-
src/additional/bic.js | 2 +-
src/additional/cnhBR.js | 2 +-
src/additional/cnpjBR.js | 2 +-
src/additional/cpfBR.js | 2 +-
src/additional/currency.js | 2 +-
src/additional/giroaccountNL.js | 2 +-
src/additional/iban.js | 2 +-
src/additional/integer.js | 2 +-
src/additional/lettersonly.js | 2 +-
src/additional/letterswithbasicpunc.js | 2 +-
src/additional/mobileNL.js | 2 +-
src/additional/mobileRU.js | 2 +-
src/additional/mobileUK.js | 2 +-
src/additional/nisBR.js | 2 +-
src/additional/nowhitespace.js | 2 +-
src/additional/phonePL.js | 2 +-
src/additional/phoneUK.js | 2 +-
src/additional/phoneUS.js | 2 +-
src/additional/phonesUK.js | 2 +-
src/additional/postalCodeCA.js | 2 +-
src/additional/postalcodeIT.js | 2 +-
src/additional/postalcodeNL.js | 2 +-
src/additional/postcodeUK.js | 2 +-
src/additional/statesUS.js | 2 +-
src/additional/strippedminlength.js | 2 +-
src/additional/time.js | 2 +-
src/additional/time12h.js | 2 +-
src/additional/zipcodeUS.js | 2 +-
src/additional/ziprange.js | 2 +-
src/localization/messages_az.js | 2 +-
src/localization/messages_ca.js | 2 +-
src/localization/messages_da.js | 12 ++++----
src/localization/messages_fa.js | 2 +-
src/localization/messages_ge.js | 2 +-
src/localization/messages_it.js | 42 +++++++++++++-------------
src/localization/messages_mk.js | 8 ++---
src/localization/messages_pl.js | 2 +-
src/localization/messages_pt_BR.js | 4 +--
src/localization/messages_ro.js | 2 +-
src/localization/messages_sr_lat.js | 2 +-
src/localization/messages_tj.js | 2 +-
src/localization/messages_tr.js | 2 +-
45 files changed, 74 insertions(+), 74 deletions(-)
diff --git a/src/additional/alphanumeric.js b/src/additional/alphanumeric.js
index 79e54e0a1..50790d61a 100644
--- a/src/additional/alphanumeric.js
+++ b/src/additional/alphanumeric.js
@@ -1,3 +1,3 @@
$.validator.addMethod( "alphanumeric", function( value, element ) {
return this.optional( element ) || /^\w+$/i.test( value );
-}, "Letters, numbers, and underscores only please" );
+}, "Letters, numbers, and underscores only please." );
diff --git a/src/additional/bankaccountNL.js b/src/additional/bankaccountNL.js
index 1671f4980..d9a0d234f 100644
--- a/src/additional/bankaccountNL.js
+++ b/src/additional/bankaccountNL.js
@@ -23,4 +23,4 @@ $.validator.addMethod( "bankaccountNL", function( value, element ) {
sum = sum + factor * digit;
}
return sum % 11 === 0;
-}, "Please specify a valid bank account number" );
+}, "Please specify a valid bank account number." );
diff --git a/src/additional/bankorgiroaccountNL.js b/src/additional/bankorgiroaccountNL.js
index b224f45b1..17eec5335 100644
--- a/src/additional/bankorgiroaccountNL.js
+++ b/src/additional/bankorgiroaccountNL.js
@@ -2,4 +2,4 @@ $.validator.addMethod( "bankorgiroaccountNL", function( value, element ) {
return this.optional( element ) ||
( $.validator.methods.bankaccountNL.call( this, value, element ) ) ||
( $.validator.methods.giroaccountNL.call( this, value, element ) );
-}, "Please specify a valid bank or giro account number" );
+}, "Please specify a valid bank or giro account number." );
diff --git a/src/additional/bic.js b/src/additional/bic.js
index 49f137fa5..4f65c59b5 100644
--- a/src/additional/bic.js
+++ b/src/additional/bic.js
@@ -15,4 +15,4 @@
*/
$.validator.addMethod( "bic", function( value, element ) {
return this.optional( element ) || /^([A-Z]{6}[A-Z2-9][A-NP-Z1-9])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test( value.toUpperCase() );
-}, "Please specify a valid BIC code" );
+}, "Please specify a valid BIC code." );
diff --git a/src/additional/cnhBR.js b/src/additional/cnhBR.js
index 67ea7965a..92e45e779 100644
--- a/src/additional/cnhBR.js
+++ b/src/additional/cnhBR.js
@@ -46,4 +46,4 @@ $.validator.addMethod( "cnhBR", function( value ) {
return ( String( firstCN ).concat( secondCN ) === value.substr( -2 ) );
-}, "Please specify a valid CNH number" );
+}, "Please specify a valid CNH number." );
diff --git a/src/additional/cnpjBR.js b/src/additional/cnpjBR.js
index 43e3bfcf6..cbe89adb3 100644
--- a/src/additional/cnpjBR.js
+++ b/src/additional/cnpjBR.js
@@ -71,4 +71,4 @@ $.validator.addMethod( "cnpjBR", function( value, element ) {
return true;
-}, "Please specify a CNPJ value number" );
+}, "Please specify a CNPJ value number." );
diff --git a/src/additional/cpfBR.js b/src/additional/cpfBR.js
index a2b1611b3..78e0da2d8 100644
--- a/src/additional/cpfBR.js
+++ b/src/additional/cpfBR.js
@@ -62,4 +62,4 @@ $.validator.addMethod( "cpfBR", function( value, element ) {
}
return false;
-}, "Please specify a valid CPF number" );
+}, "Please specify a valid CPF number." );
diff --git a/src/additional/currency.js b/src/additional/currency.js
index 76197df5a..d593790e3 100644
--- a/src/additional/currency.js
+++ b/src/additional/currency.js
@@ -38,4 +38,4 @@ $.validator.addMethod( "currency", function( value, element, param ) {
regex = new RegExp( regex );
return this.optional( element ) || regex.test( value );
-}, "Please specify a valid currency" );
+}, "Please specify a valid currency." );
diff --git a/src/additional/giroaccountNL.js b/src/additional/giroaccountNL.js
index 0cfd04cd6..26ea14fba 100644
--- a/src/additional/giroaccountNL.js
+++ b/src/additional/giroaccountNL.js
@@ -3,4 +3,4 @@
*/
$.validator.addMethod( "giroaccountNL", function( value, element ) {
return this.optional( element ) || /^[0-9]{1,7}$/.test( value );
-}, "Please specify a valid giro account number" );
+}, "Please specify a valid giro account number." );
diff --git a/src/additional/iban.js b/src/additional/iban.js
index 0a2bfbeec..94c610d8f 100644
--- a/src/additional/iban.js
+++ b/src/additional/iban.js
@@ -133,4 +133,4 @@ $.validator.addMethod( "iban", function( value, element ) {
cRest = cOperator % 97;
}
return cRest === 1;
-}, "Please specify a valid IBAN" );
+}, "Please specify a valid IBAN." );
diff --git a/src/additional/integer.js b/src/additional/integer.js
index 779431d72..ad0dab2fa 100644
--- a/src/additional/integer.js
+++ b/src/additional/integer.js
@@ -1,3 +1,3 @@
$.validator.addMethod( "integer", function( value, element ) {
return this.optional( element ) || /^-?\d+$/.test( value );
-}, "A positive or negative non-decimal number please" );
+}, "A positive or negative non-decimal number please." );
diff --git a/src/additional/lettersonly.js b/src/additional/lettersonly.js
index 893b487a8..82857661b 100644
--- a/src/additional/lettersonly.js
+++ b/src/additional/lettersonly.js
@@ -1,3 +1,3 @@
$.validator.addMethod( "lettersonly", function( value, element ) {
return this.optional( element ) || /^[a-z]+$/i.test( value );
-}, "Letters only please" );
+}, "Letters only please." );
diff --git a/src/additional/letterswithbasicpunc.js b/src/additional/letterswithbasicpunc.js
index 9bbb4d9d9..0e90c0555 100644
--- a/src/additional/letterswithbasicpunc.js
+++ b/src/additional/letterswithbasicpunc.js
@@ -1,3 +1,3 @@
$.validator.addMethod( "letterswithbasicpunc", function( value, element ) {
return this.optional( element ) || /^[a-z\-.,()'"\s]+$/i.test( value );
-}, "Letters or punctuation only please" );
+}, "Letters or punctuation only please." );
diff --git a/src/additional/mobileNL.js b/src/additional/mobileNL.js
index 3f1f45a75..12092e2ea 100644
--- a/src/additional/mobileNL.js
+++ b/src/additional/mobileNL.js
@@ -1,3 +1,3 @@
$.validator.addMethod( "mobileNL", function( value, element ) {
return this.optional( element ) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test( value );
-}, "Please specify a valid mobile number" );
+}, "Please specify a valid mobile number." );
diff --git a/src/additional/mobileRU.js b/src/additional/mobileRU.js
index 7006d09b4..c135be752 100644
--- a/src/additional/mobileRU.js
+++ b/src/additional/mobileRU.js
@@ -1,4 +1,4 @@
$.validator.addMethod( "mobileRU", function( phone_number, element ) {
var ruPhone_number = phone_number.replace( /\(|\)|\s+|-/g, "" );
return this.optional( element ) || ruPhone_number.length > 9 && /^((\+7|7|8)+([0-9]){10})$/.test( ruPhone_number );
-}, "Please specify a valid mobile number" );
+}, "Please specify a valid mobile number." );
diff --git a/src/additional/mobileUK.js b/src/additional/mobileUK.js
index e1c5ce3b2..e2d02ae9b 100644
--- a/src/additional/mobileUK.js
+++ b/src/additional/mobileUK.js
@@ -10,4 +10,4 @@ $.validator.addMethod( "mobileUK", function( phone_number, element ) {
phone_number = phone_number.replace( /\(|\)|\s+|-/g, "" );
return this.optional( element ) || phone_number.length > 9 &&
phone_number.match( /^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/ );
-}, "Please specify a valid mobile number" );
+}, "Please specify a valid mobile number." );
diff --git a/src/additional/nisBR.js b/src/additional/nisBR.js
index 7a685d1cb..3d305787d 100644
--- a/src/additional/nisBR.js
+++ b/src/additional/nisBR.js
@@ -54,4 +54,4 @@ $.validator.addMethod( "nisBR", function( value ) {
} else {
return false;
}
-}, "Please specify a valid NIS/PIS number" );
+}, "Please specify a valid NIS/PIS number." );
diff --git a/src/additional/nowhitespace.js b/src/additional/nowhitespace.js
index 7f6c3bd43..86a3b9703 100644
--- a/src/additional/nowhitespace.js
+++ b/src/additional/nowhitespace.js
@@ -1,3 +1,3 @@
$.validator.addMethod( "nowhitespace", function( value, element ) {
return this.optional( element ) || /^\S+$/i.test( value );
-}, "No white space please" );
+}, "No white space please." );
diff --git a/src/additional/phonePL.js b/src/additional/phonePL.js
index cca314df4..f62f5fcb3 100644
--- a/src/additional/phonePL.js
+++ b/src/additional/phonePL.js
@@ -20,4 +20,4 @@ $.validator.addMethod( "phonePL", function( phone_number, element ) {
phone_number = phone_number.replace( /\s+/g, "" );
var regexp = /^(?:(?:(?:\+|00)?48)|(?:\(\+?48\)))?(?:1[2-8]|2[2-69]|3[2-49]|4[1-68]|5[0-9]|6[0-35-9]|[7-8][1-9]|9[145])\d{7}$/;
return this.optional( element ) || regexp.test( phone_number );
-}, "Please specify a valid phone number" );
+}, "Please specify a valid phone number." );
diff --git a/src/additional/phoneUK.js b/src/additional/phoneUK.js
index b97866f09..af53bf1f6 100644
--- a/src/additional/phoneUK.js
+++ b/src/additional/phoneUK.js
@@ -10,4 +10,4 @@ $.validator.addMethod( "phoneUK", function( phone_number, element ) {
phone_number = phone_number.replace( /\(|\)|\s+|-/g, "" );
return this.optional( element ) || phone_number.length > 9 &&
phone_number.match( /^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/ );
-}, "Please specify a valid phone number" );
+}, "Please specify a valid phone number." );
diff --git a/src/additional/phoneUS.js b/src/additional/phoneUS.js
index 894a25c67..ed1c3d2fd 100644
--- a/src/additional/phoneUS.js
+++ b/src/additional/phoneUS.js
@@ -18,4 +18,4 @@ $.validator.addMethod( "phoneUS", function( phone_number, element ) {
phone_number = phone_number.replace( /\s+/g, "" );
return this.optional( element ) || phone_number.length > 9 &&
phone_number.match( /^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]\d{2}-?\d{4}$/ );
-}, "Please specify a valid phone number" );
+}, "Please specify a valid phone number." );
diff --git a/src/additional/phonesUK.js b/src/additional/phonesUK.js
index fa04167d5..e5678d612 100644
--- a/src/additional/phonesUK.js
+++ b/src/additional/phonesUK.js
@@ -12,4 +12,4 @@ $.validator.addMethod( "phonesUK", function( phone_number, element ) {
phone_number = phone_number.replace( /\(|\)|\s+|-/g, "" );
return this.optional( element ) || phone_number.length > 9 &&
phone_number.match( /^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/ );
-}, "Please specify a valid uk phone number" );
+}, "Please specify a valid uk phone number." );
diff --git a/src/additional/postalCodeCA.js b/src/additional/postalCodeCA.js
index ba3bb4a4e..7082d967e 100644
--- a/src/additional/postalCodeCA.js
+++ b/src/additional/postalCodeCA.js
@@ -13,4 +13,4 @@
*/
$.validator.addMethod( "postalCodeCA", function( value, element ) {
return this.optional( element ) || /^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ] *\d[ABCEGHJKLMNPRSTVWXYZ]\d$/i.test( value );
-}, "Please specify a valid postal code" );
+}, "Please specify a valid postal code." );
diff --git a/src/additional/postalcodeIT.js b/src/additional/postalcodeIT.js
index 38ea89d2b..a229956e6 100644
--- a/src/additional/postalcodeIT.js
+++ b/src/additional/postalcodeIT.js
@@ -1,4 +1,4 @@
/* Matches Italian postcode (CAP) */
$.validator.addMethod( "postalcodeIT", function( value, element ) {
return this.optional( element ) || /^\d{5}$/.test( value );
-}, "Please specify a valid postal code" );
+}, "Please specify a valid postal code." );
diff --git a/src/additional/postalcodeNL.js b/src/additional/postalcodeNL.js
index 38a547623..78707fd39 100644
--- a/src/additional/postalcodeNL.js
+++ b/src/additional/postalcodeNL.js
@@ -1,3 +1,3 @@
$.validator.addMethod( "postalcodeNL", function( value, element ) {
return this.optional( element ) || /^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test( value );
-}, "Please specify a valid postal code" );
+}, "Please specify a valid postal code." );
diff --git a/src/additional/postcodeUK.js b/src/additional/postcodeUK.js
index 26a4743c8..b5d2618a8 100644
--- a/src/additional/postcodeUK.js
+++ b/src/additional/postcodeUK.js
@@ -1,4 +1,4 @@
// Matches UK postcode. Does not match to UK Channel Islands that have their own postcodes (non standard UK)
$.validator.addMethod( "postcodeUK", function( value, element ) {
return this.optional( element ) || /^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test( value );
-}, "Please specify a valid UK postcode" );
+}, "Please specify a valid UK postcode." );
diff --git a/src/additional/statesUS.js b/src/additional/statesUS.js
index 015894f3b..b26c33743 100644
--- a/src/additional/statesUS.js
+++ b/src/additional/statesUS.js
@@ -51,4 +51,4 @@ $.validator.addMethod( "stateUS", function( value, element, options ) {
regex = caseSensitive ? new RegExp( regex ) : new RegExp( regex, "i" );
return this.optional( element ) || regex.test( value );
-}, "Please specify a valid state" );
+}, "Please specify a valid state." );
diff --git a/src/additional/strippedminlength.js b/src/additional/strippedminlength.js
index e5bf73434..0b7006deb 100644
--- a/src/additional/strippedminlength.js
+++ b/src/additional/strippedminlength.js
@@ -1,4 +1,4 @@
// TODO check if value starts with <, otherwise don't try stripping anything
$.validator.addMethod( "strippedminlength", function( value, element, param ) {
return $( value ).text().length >= param;
-}, $.validator.format( "Please enter at least {0} characters" ) );
+}, $.validator.format( "Please enter at least {0} characters." ) );
diff --git a/src/additional/time.js b/src/additional/time.js
index 2bcbce13e..82c9806d0 100644
--- a/src/additional/time.js
+++ b/src/additional/time.js
@@ -1,3 +1,3 @@
$.validator.addMethod( "time", function( value, element ) {
return this.optional( element ) || /^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test( value );
-}, "Please enter a valid time, between 00:00 and 23:59" );
+}, "Please enter a valid time, between 00:00 and 23:59." );
diff --git a/src/additional/time12h.js b/src/additional/time12h.js
index fcd3fa288..402e4d2da 100644
--- a/src/additional/time12h.js
+++ b/src/additional/time12h.js
@@ -1,3 +1,3 @@
$.validator.addMethod( "time12h", function( value, element ) {
return this.optional( element ) || /^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test( value );
-}, "Please enter a valid time in 12-hour am/pm format" );
+}, "Please enter a valid time in 12-hour am/pm format." );
diff --git a/src/additional/zipcodeUS.js b/src/additional/zipcodeUS.js
index 8d52ac0b5..15c85dd58 100644
--- a/src/additional/zipcodeUS.js
+++ b/src/additional/zipcodeUS.js
@@ -1,3 +1,3 @@
$.validator.addMethod( "zipcodeUS", function( value, element ) {
return this.optional( element ) || /^\d{5}(-\d{4})?$/.test( value );
-}, "The specified US ZIP Code is invalid" );
+}, "The specified US ZIP Code is invalid." );
diff --git a/src/additional/ziprange.js b/src/additional/ziprange.js
index 48dc6836d..7e501d5b1 100644
--- a/src/additional/ziprange.js
+++ b/src/additional/ziprange.js
@@ -1,3 +1,3 @@
$.validator.addMethod( "ziprange", function( value, element ) {
return this.optional( element ) || /^90[2-5]\d\{2\}-\d{4}$/.test( value );
-}, "Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx" );
+}, "Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx." );
diff --git a/src/localization/messages_az.js b/src/localization/messages_az.js
index 61956a2d4..f629c8080 100644
--- a/src/localization/messages_az.js
+++ b/src/localization/messages_az.js
@@ -19,5 +19,5 @@ $.extend( $.validator.messages, {
rangelength: $.validator.format( "Zəhmət olmasa, {0} - {1} aralığında uzunluğa malik simvol daxil edin." ),
range: $.validator.format( "Zəhmət olmasa, {0} - {1} aralığında rəqəm daxil edin." ),
max: $.validator.format( "Zəhmət olmasa, {0} və ondan kiçik rəqəm daxil edin." ),
- min: $.validator.format( "Zəhmət olmasa, {0} və ondan böyük rəqəm daxil edin" )
+ min: $.validator.format( "Zəhmət olmasa, {0} və ondan böyük rəqəm daxil edin." )
} );
diff --git a/src/localization/messages_ca.js b/src/localization/messages_ca.js
index 2d650bc86..0c9184ac8 100644
--- a/src/localization/messages_ca.js
+++ b/src/localization/messages_ca.js
@@ -5,7 +5,7 @@
$.extend( $.validator.messages, {
required: "Aquest camp és obligatori.",
remote: "Si us plau, omple aquest camp.",
- email: "Si us plau, escriu una adreça de correu-e vàlida",
+ email: "Si us plau, escriu una adreça de correu-e vàlida.",
url: "Si us plau, escriu una URL vàlida.",
date: "Si us plau, escriu una data vàlida.",
dateISO: "Si us plau, escriu una data (ISO) vàlida.",
diff --git a/src/localization/messages_da.js b/src/localization/messages_da.js
index 4c0efcc1b..b41079412 100644
--- a/src/localization/messages_da.js
+++ b/src/localization/messages_da.js
@@ -4,7 +4,7 @@
*/
$.extend( $.validator.messages, {
required: "Dette felt er påkrævet.",
- remote: "Ret venligst dette felt",
+ remote: "Ret venligst dette felt.",
email: "Indtast en gyldig email-adresse.",
url: "Indtast en gyldig URL.",
date: "Indtast en gyldig dato.",
@@ -16,18 +16,18 @@ $.extend( $.validator.messages, {
ipv4: "Angiv venligst en gyldig IPv4-adresse.",
ipv6: "Angiv venligst en gyldig IPv6-adresse.",
require_from_group: $.validator.format( "Angiv mindst {0} af disse felter." ),
- extension: "Indtast venligst en værdi med en gyldig endelse",
- pattern: "Ugyldigt format",
+ extension: "Indtast venligst en værdi med en gyldig endelse.",
+ pattern: "Ugyldigt format.",
lettersonly: "Angiv venligst kun bogstaver.",
- nowhitespace: "Må ikke indholde mellemrum",
+ nowhitespace: "Må ikke indholde mellemrum.",
maxlength: $.validator.format( "Indtast højst {0} tegn." ),
minlength: $.validator.format( "Indtast mindst {0} tegn." ),
rangelength: $.validator.format( "Indtast mindst {0} og højst {1} tegn." ),
range: $.validator.format( "Angiv en værdi mellem {0} og {1}." ),
max: $.validator.format( "Angiv en værdi der højst er {0}." ),
min: $.validator.format( "Angiv en værdi der mindst er {0}." ),
- minWords: $.validator.format( "Indtast venligst mindst {0} ord" ),
- maxWords: $.validator.format( "Indtast venligst højst {0} ord" ),
+ minWords: $.validator.format( "Indtast venligst mindst {0} ord." ),
+ maxWords: $.validator.format( "Indtast venligst højst {0} ord." ),
step: $.validator.format( "Angiv en værdi gange {0}." ),
notEqualTo: "Angiv en anden værdi, værdierne må ikke være det samme.",
integer: "Angiv et ikke-decimaltal, der er positivt eller negativt."
diff --git a/src/localization/messages_fa.js b/src/localization/messages_fa.js
index 234687bd7..c323a8119 100644
--- a/src/localization/messages_fa.js
+++ b/src/localization/messages_fa.js
@@ -14,7 +14,7 @@ $.extend( $.validator.messages, {
digits: "لطفا تنها رقم وارد کنید.",
creditcard: "لطفا کریدیت کارت صحیح وارد کنید.",
equalTo: "لطفا مقدار برابری وارد کنید.",
- extension: "لطفا مقداری وارد کنید که",
+ extension: "لطفا مقداری وارد کنید که.",
alphanumeric: "لطفا مقدار را عدد (انگلیسی) وارد کنید.",
maxlength: $.validator.format( "لطفا بیشتر از {0} حرف وارد نکنید." ),
minlength: $.validator.format( "لطفا کمتر از {0} حرف وارد نکنید." ),
diff --git a/src/localization/messages_ge.js b/src/localization/messages_ge.js
index 95c40d4fa..bfcd3f5e1 100644
--- a/src/localization/messages_ge.js
+++ b/src/localization/messages_ge.js
@@ -4,7 +4,7 @@
* Locale: GE (Georgian; ქართული)
*/
$.extend( $.validator.messages, {
- required: "ეს ველი სავალდებულოა",
+ required: "ეს ველი სავალდებულოა.",
remote: "გთხოვთ შეასწოროთ.",
email: "გთხოვთ შეიყვანოთ სწორი ფორმატით.",
url: "გთხოვთ შეიყვანოთ სწორი ფორმატით.",
diff --git a/src/localization/messages_it.js b/src/localization/messages_it.js
index 54f07e106..111509454 100644
--- a/src/localization/messages_it.js
+++ b/src/localization/messages_it.js
@@ -3,25 +3,25 @@
* Locale: IT (Italian; Italiano)
*/
$.extend( $.validator.messages, {
- required: "Campo obbligatorio",
- remote: "Controlla questo campo",
- email: "Inserisci un indirizzo email valido",
- url: "Inserisci un indirizzo web valido",
- date: "Inserisci una data valida",
- dateISO: "Inserisci una data valida (ISO)",
- number: "Inserisci un numero valido",
- digits: "Inserisci solo numeri",
- creditcard: "Inserisci un numero di carta di credito valido",
- equalTo: "Il valore non corrisponde",
- extension: "Inserisci un valore con un'estensione valida",
- maxlength: $.validator.format( "Non inserire più di {0} caratteri" ),
- minlength: $.validator.format( "Inserisci almeno {0} caratteri" ),
- rangelength: $.validator.format( "Inserisci un valore compreso tra {0} e {1} caratteri" ),
- range: $.validator.format( "Inserisci un valore compreso tra {0} e {1}" ),
- max: $.validator.format( "Inserisci un valore minore o uguale a {0}" ),
- min: $.validator.format( "Inserisci un valore maggiore o uguale a {0}" ),
- nifES: "Inserisci un NIF valido",
- nieES: "Inserisci un NIE valido",
- cifES: "Inserisci un CIF valido",
- currency: "Inserisci una valuta valida"
+ required: "Campo obbligatorio.",
+ remote: "Controlla questo campo.",
+ email: "Inserisci un indirizzo email valido.",
+ url: "Inserisci un indirizzo web valido.",
+ date: "Inserisci una data valida.",
+ dateISO: "Inserisci una data valida (ISO).",
+ number: "Inserisci un numero valido.",
+ digits: "Inserisci solo numeri.",
+ creditcard: "Inserisci un numero di carta di credito valido.",
+ equalTo: "Il valore non corrisponde.",
+ extension: "Inserisci un valore con un'estensione valida.",
+ maxlength: $.validator.format( "Non inserire più di {0} caratteri." ),
+ minlength: $.validator.format( "Inserisci almeno {0} caratteri." ),
+ rangelength: $.validator.format( "Inserisci un valore compreso tra {0} e {1} caratteri." ),
+ range: $.validator.format( "Inserisci un valore compreso tra {0} e {1}." ),
+ max: $.validator.format( "Inserisci un valore minore o uguale a {0}." ),
+ min: $.validator.format( "Inserisci un valore maggiore o uguale a {0}." ),
+ nifES: "Inserisci un NIF valido.",
+ nieES: "Inserisci un NIE valido.",
+ cifES: "Inserisci un CIF valido.",
+ currency: "Inserisci una valuta valida."
} );
diff --git a/src/localization/messages_mk.js b/src/localization/messages_mk.js
index 21da3282f..24fb59785 100644
--- a/src/localization/messages_mk.js
+++ b/src/localization/messages_mk.js
@@ -4,10 +4,10 @@
*/
$.extend( $.validator.messages, {
required: "Полето е задолжително.",
- remote: "Поправете го ова поле",
- email: "Внесете правилна e-mail адреса",
+ remote: "Поправете го ова поле.",
+ email: "Внесете правилна e-mail адреса.",
url: "Внесете правилен URL.",
- date: "Внесете правилен датум",
+ date: "Внесете правилен датум.",
dateISO: "Внесете правилен датум (ISO).",
number: "Внесете правилен број.",
digits: "Внесете само бројки.",
@@ -19,5 +19,5 @@ $.extend( $.validator.messages, {
rangelength: $.validator.format( "Внесете вредност со должина помеѓу {0} и {1} знаци." ),
range: $.validator.format( "Внесете вредност помеѓу {0} и {1}." ),
max: $.validator.format( "Внесете вредност помала или еднаква на {0}." ),
- min: $.validator.format( "Внесете вредност поголема или еднаква на {0}" )
+ min: $.validator.format( "Внесете вредност поголема или еднаква на {0}." )
} );
diff --git a/src/localization/messages_pl.js b/src/localization/messages_pl.js
index 1f77009ec..c67b396d3 100644
--- a/src/localization/messages_pl.js
+++ b/src/localization/messages_pl.js
@@ -15,7 +15,7 @@ $.extend( $.validator.messages, {
equalTo: "Proszę o podanie tej samej wartości ponownie.",
extension: "Proszę o podanie wartości z prawidłowym rozszerzeniem.",
nipPL: "Proszę o podanie prawidłowego numeru NIP.",
- phonePL: "Proszę o podanie prawidłowego numeru telefonu",
+ phonePL: "Proszę o podanie prawidłowego numeru telefonu.",
maxlength: $.validator.format( "Proszę o podanie nie więcej niż {0} znaków." ),
minlength: $.validator.format( "Proszę o podanie przynajmniej {0} znaków." ),
rangelength: $.validator.format( "Proszę o podanie wartości o długości od {0} do {1} znaków." ),
diff --git a/src/localization/messages_pt_BR.js b/src/localization/messages_pt_BR.js
index cfd018de8..996c844be 100644
--- a/src/localization/messages_pt_BR.js
+++ b/src/localization/messages_pt_BR.js
@@ -71,9 +71,9 @@ $.extend( $.validator.messages, {
url2: "Por favor, forneça uma URL válida.",
vinUS: "O número de identificação de veículo informado (VIN) é inválido.",
zipcodeUS: "Por favor, forneça um código postal americano válido.",
- ziprange: "O código postal deve estar entre 902xx-xxxx e 905xx-xxxx",
+ ziprange: "O código postal deve estar entre 902xx-xxxx e 905xx-xxxx.",
cpfBR: "Por favor, forneça um CPF válido.",
- nisBR: "Por favor, forneça um NIS/PIS válido",
+ nisBR: "Por favor, forneça um NIS/PIS válido.",
cnhBR: "Por favor, forneça um CNH válido.",
cnpjBR: "Por favor, forneça um CNPJ válido."
} );
diff --git a/src/localization/messages_ro.js b/src/localization/messages_ro.js
index 7ea626b42..4b3190b79 100644
--- a/src/localization/messages_ro.js
+++ b/src/localization/messages_ro.js
@@ -5,7 +5,7 @@
$.extend( $.validator.messages, {
required: "Acest câmp este obligatoriu.",
remote: "Te rugăm să completezi acest câmp.",
- email: "Te rugăm să introduci o adresă de email validă",
+ email: "Te rugăm să introduci o adresă de email validă.",
url: "Te rugăm sa introduci o adresă URL validă.",
date: "Te rugăm să introduci o dată corectă.",
dateISO: "Te rugăm să introduci o dată (ISO) corectă.",
diff --git a/src/localization/messages_sr_lat.js b/src/localization/messages_sr_lat.js
index 43666f98d..07b74137b 100644
--- a/src/localization/messages_sr_lat.js
+++ b/src/localization/messages_sr_lat.js
@@ -5,7 +5,7 @@
$.extend( $.validator.messages, {
required: "Polje je obavezno.",
remote: "Sredite ovo polje.",
- email: "Unesite ispravnu e-mail adresu",
+ email: "Unesite ispravnu e-mail adresu.",
url: "Unesite ispravan URL.",
date: "Unesite ispravan datum.",
dateISO: "Unesite ispravan datum (ISO).",
diff --git a/src/localization/messages_tj.js b/src/localization/messages_tj.js
index 4bbb4d2c4..c540461d9 100644
--- a/src/localization/messages_tj.js
+++ b/src/localization/messages_tj.js
@@ -13,7 +13,7 @@ $.extend( $.validator.messages, {
digits: "Илтимос, танҳо рақам ворид кунед.",
creditcard: "Илтимос, кредит карди саҳеҳ ворид кунед.",
equalTo: "Илтимос, миқдори баробар ворид кунед.",
- extension: "Илтимос, қофияи файлро дуруст интихоб кунед",
+ extension: "Илтимос, қофияи файлро дуруст интихоб кунед.",
maxlength: $.validator.format( "Илтимос, бештар аз {0} рамз ворид накунед." ),
minlength: $.validator.format( "Илтимос, камтар аз {0} рамз ворид накунед." ),
rangelength: $.validator.format( "Илтимос, камтар аз {0} ва зиёда аз {1} рамз ворид кунед." ),
diff --git a/src/localization/messages_tr.js b/src/localization/messages_tr.js
index 8d8086048..509c6f5f6 100644
--- a/src/localization/messages_tr.js
+++ b/src/localization/messages_tr.js
@@ -8,7 +8,7 @@ $.extend( $.validator.messages, {
email: "Lütfen geçerli bir e-posta adresi giriniz.",
url: "Lütfen geçerli bir web adresi (URL) giriniz.",
date: "Lütfen geçerli bir tarih giriniz.",
- dateISO: "Lütfen geçerli bir tarih giriniz(ISO formatında)",
+ dateISO: "Lütfen geçerli bir tarih giriniz(ISO formatında).",
number: "Lütfen geçerli bir sayı giriniz.",
digits: "Lütfen sadece sayısal karakterler giriniz.",
creditcard: "Lütfen geçerli bir kredi kartı giriniz.",
From 0da490675cdc1d1ce0b6644c3f4ad14023d53238 Mon Sep 17 00:00:00 2001
From: Kieran
Date: Mon, 23 May 2022 23:48:30 +0100
Subject: [PATCH 04/38] Core: fix deprecated jquery .submit() event shorthand
(#2430)
* Core: fix deprecated jquery .submit() event shorthand
* Core: jscs
---
src/core.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core.js b/src/core.js
index 5f4d362b5..088be16d7 100644
--- a/src/core.js
+++ b/src/core.js
@@ -1113,7 +1113,7 @@ $.extend( $.validator, {
delete this.pending[ element.name ];
$( element ).removeClass( this.settings.pendingClass );
if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() && this.pendingRequest === 0 ) {
- $( this.currentForm ).submit();
+ $( this.currentForm ).trigger( "submit" );
// Remove the hidden input that was used as a replacement for the
// missing submit button. The hidden input is added by `handle()`
From 3d3c1fb880c3c623da334e9b6b32a861a16efeb8 Mon Sep 17 00:00:00 2001
From: Kieran
Date: Thu, 23 Jun 2022 17:05:23 +0100
Subject: [PATCH 05/38] Chore: Add CodeQL analysis
---
.github/workflows/codeql-analysis.yml | 72 +++++++++++++++++++++++++++
1 file changed, 72 insertions(+)
create mode 100644 .github/workflows/codeql-analysis.yml
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
new file mode 100644
index 000000000..7ef364fb7
--- /dev/null
+++ b/.github/workflows/codeql-analysis.yml
@@ -0,0 +1,72 @@
+# For most projects, this workflow file will not need changing; you simply need
+# to commit it to your repository.
+#
+# You may wish to alter this file to override the set of languages analyzed,
+# or to provide custom queries or build logic.
+#
+# ******** NOTE ********
+# We have attempted to detect the languages in your repository. Please check
+# the `language` matrix defined below to confirm you have the correct set of
+# supported CodeQL languages.
+#
+name: "CodeQL"
+
+on:
+ push:
+ branches: [ "master" ]
+ pull_request:
+ # The branches below must be a subset of the branches above
+ branches: [ "master" ]
+ schedule:
+ - cron: '19 23 * * 1'
+
+jobs:
+ analyze:
+ name: Analyze
+ runs-on: ubuntu-latest
+ permissions:
+ actions: read
+ contents: read
+ security-events: write
+
+ strategy:
+ fail-fast: false
+ matrix:
+ language: [ 'javascript' ]
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
+ # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v3
+
+ # Initializes the CodeQL tools for scanning.
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v2
+ with:
+ languages: ${{ matrix.language }}
+ # If you wish to specify custom queries, you can do so here or in a config file.
+ # By default, queries listed here will override any specified in a config file.
+ # Prefix the list here with "+" to use these queries and those in the config file.
+
+ # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
+ # queries: security-extended,security-and-quality
+
+
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
+ # If this step fails, then you should remove it and run the build manually (see below)
+ - name: Autobuild
+ uses: github/codeql-action/autobuild@v2
+
+ # ℹ️ Command-line programs to run using the OS shell.
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
+
+ # If the Autobuild fails above, remove it and uncomment the following three lines.
+ # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
+
+ # - run: |
+ # echo "Run, Build Application using script"
+ # ./location_of_script_within_repo/buildscript.sh
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v2
From 5bbd80d27fc6b607d2f7f106c89522051a9fb0dd Mon Sep 17 00:00:00 2001
From: Kieran
Date: Fri, 1 Jul 2022 16:00:37 +0100
Subject: [PATCH 06/38] Merge pull request from GHSA-ffmh-x56j-9rc3
(cherry picked from commit a3908cc082465000a3afa4bed47418b6e02c14ed)
---
src/additional/url2.js | 2 +-
src/core.js | 2 +-
test/methods.js | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/additional/url2.js b/src/additional/url2.js
index 955851a49..e7c8f42df 100644
--- a/src/additional/url2.js
+++ b/src/additional/url2.js
@@ -1,4 +1,4 @@
// Same as url, but TLD is optional
$.validator.addMethod( "url2", function( value, element ) {
- 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 );
+ 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,}\.?)|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff])|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62}\.)))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value );
}, $.validator.messages.url );
diff --git a/src/core.js b/src/core.js
index 088be16d7..ddb258119 100644
--- a/src/core.js
+++ b/src/core.js
@@ -1416,7 +1416,7 @@ $.extend( $.validator, {
// https://gist.github.com/dperini/729294
// see also https://mathiasbynens.be/demo/url-regex
// modified to allow protocol-relative URLs
- 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 );
+ 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 );
},
// https://jqueryvalidation.org/date-method/
diff --git a/test/methods.js b/test/methods.js
index 743267cab..fa49939e4 100644
--- a/test/methods.js
+++ b/test/methods.js
@@ -123,9 +123,9 @@ QUnit.test( "url2 (tld optional)", function( assert ) {
assert.ok( method( "http://www.føtex.dk/" ), "Valid url, danish unicode characters" );
assert.ok( method( "http://bösendorfer.de/" ), "Valid url, german unicode characters" );
assert.ok( method( "http://142.42.1.1" ), "Valid IP Address" );
+ assert.ok( method( "http://bassistance" ), "Valid URL (optional TLD)" );
+ assert.ok( method( "http://bassistance." ), "Valid URL (optional TLD)" );
assert.ok( !method( "http://192.168.8." ), "Invalid IP Address" );
- assert.ok( method( "http://bassistance" ), "Invalid url" );
- assert.ok( method( "http://bassistance." ), "Invalid url" );
assert.ok( !method( "http://bassistance,de" ), "Invalid url" );
assert.ok( !method( "http://bassistance;de" ), "Invalid url" );
assert.ok( !method( "http://.bassistancede" ), "Invalid url" );
From 1c4f409aef4930040753ab59b5532b7e430f37cc Mon Sep 17 00:00:00 2001
From: Kieran Brahney
Date: Fri, 1 Jul 2022 16:20:23 +0100
Subject: [PATCH 07/38] Build: Updating the master version to 1.19.6-pre.
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 0bc214db1..2cc35a6bc 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "jquery-validation",
"title": "jQuery Validation Plugin",
"description": "Client-side form validation made easy",
- "version": "1.19.5-pre",
+ "version": "1.19.6-pre",
"homepage": "https://jqueryvalidation.org/",
"license": "MIT",
"author": {
From 73c645d7d5f879543c32f03f5231200e3748fc30 Mon Sep 17 00:00:00 2001
From: Kieran Brahney
Date: Fri, 1 Jul 2022 16:30:42 +0100
Subject: [PATCH 08/38] Chore: update changelog
---
changelog.md | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/changelog.md b/changelog.md
index 284e5a15c..ca71122fb 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,3 +1,16 @@
+1.19.5 / 2022-06-01
+===================
+
+## Chore
+ * Add CodeQL analysis [3d3c1fb](https://github.com/jquery-validation/jquery-validation/commit/3d3c1fb880c3c623da334e9b6b32a861a16efeb8)
+
+## Core
+ * Fixed jQuery .submit() event shorthand deprecation notice [#2430](https://github.com/jquery-validation/jquery-validation/pull/2430)
+ * Fixed ReDos vulnerability in url, and url2 validation [5bbd80d](https://github.com/jquery-validation/jquery-validation/commit/5bbd80d27fc6b607d2f7f106c89522051a9fb0dd)
+
+## Localisation
+ * Added periods to messages [#2266](https://github.com/jquery-validation/jquery-validation/pull/2266)
+
1.19.4 / 2022-05-19
===================
@@ -28,7 +41,7 @@
* Add Accessibility section to Readme (#2149)
## Localization
- * Add "pattern" translation for French (#2363)
+ * Add "pattern" translation for French (#2363)
* add phone validate translate for Turkish translation (#2343)
1.19.2 / 2020-05-23
@@ -160,7 +173,7 @@ The hashes for the 1.19.0 release can be found in the file [`jquery-validation-s
## Tests
* Pass on the value of the used submit button for scripted submits (#2019)
* Use assert#pushResult instead of assert#push (#2018)
-
+
## All
* Fix links after move to organization
* Use https
From 24f2e277f1cb2c4d0dfcd97ae35997d43136dfbe Mon Sep 17 00:00:00 2001
From: Kieran
Date: Fri, 1 Jul 2022 21:39:27 +0100
Subject: [PATCH 09/38] Chore: correct 1.19.5 release date
---
changelog.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/changelog.md b/changelog.md
index ca71122fb..6bbbd5ccb 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,4 +1,4 @@
-1.19.5 / 2022-06-01
+1.19.5 / 2022-07-01
===================
## Chore
From 980087a897c1d3a03b87f8d07cf756e8b9bba6d5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sylvain=20Monn=C3=A9?=
Date: Fri, 15 Jul 2022 23:26:56 +0200
Subject: [PATCH 10/38] Core: fix race condition in remote validation rules
(#2435)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes #2434
Co-authored-by: Sylvain Monné
---
src/ajax.js | 17 +++++++++++------
src/core.js | 27 ++++++++++++++++++++++++++-
test/methods.js | 30 ++++++++++++++++++++++++++++++
3 files changed, 67 insertions(+), 7 deletions(-)
diff --git a/src/ajax.js b/src/ajax.js
index fb56de4b3..5f87bed20 100644
--- a/src/ajax.js
+++ b/src/ajax.js
@@ -1,5 +1,6 @@
// Ajax mode: abort
// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]});
+// $.ajaxAbort( port );
// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort()
var pendingRequests = {},
@@ -10,9 +11,7 @@ if ( $.ajaxPrefilter ) {
$.ajaxPrefilter( function( settings, _, xhr ) {
var port = settings.port;
if ( settings.mode === "abort" ) {
- if ( pendingRequests[ port ] ) {
- pendingRequests[ port ].abort();
- }
+ $.ajaxAbort( port );
pendingRequests[ port ] = xhr;
}
} );
@@ -24,12 +23,18 @@ if ( $.ajaxPrefilter ) {
var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode,
port = ( "port" in settings ? settings : $.ajaxSettings ).port;
if ( mode === "abort" ) {
- if ( pendingRequests[ port ] ) {
- pendingRequests[ port ].abort();
- }
+ $.ajaxAbort( port );
pendingRequests[ port ] = ajax.apply( this, arguments );
return pendingRequests[ port ];
}
return ajax.apply( this, arguments );
};
}
+
+// Abort the previous request without sending a new one
+$.ajaxAbort = function( port ) {
+ if ( pendingRequests[ port ] ) {
+ pendingRequests[ port ].abort();
+ delete pendingRequests[ port ];
+ }
+};
diff --git a/src/core.js b/src/core.js
index ddb258119..923b3012b 100644
--- a/src/core.js
+++ b/src/core.js
@@ -756,6 +756,9 @@ $.extend( $.validator, {
val = this.elementValue( element ),
result, method, rule, normalizer;
+ // Abort any pending Ajax request from a previous call to this method.
+ this.abortRequest( element );
+
// Prioritize the local normalizer defined for this element over the global one
// if the former exists, otherwise user the global one in case it exists.
if ( typeof rules.normalizer === "function" ) {
@@ -1095,6 +1098,10 @@ $.extend( $.validator, {
return !$.validator.methods.required.call( this, val, element ) && "dependency-mismatch";
},
+ elementAjaxPort: function( element ) {
+ return "validate" + element.name;
+ },
+
startRequest: function( element ) {
if ( !this.pending[ element.name ] ) {
this.pendingRequest++;
@@ -1130,6 +1137,24 @@ $.extend( $.validator, {
}
},
+ abortRequest: function( element ) {
+ var port;
+
+ if ( this.pending[ element.name ] ) {
+ port = this.elementAjaxPort( element );
+ $.ajaxAbort( port );
+
+ this.pendingRequest--;
+
+ // Sometimes synchronization fails, make sure pendingRequest is never < 0
+ if ( this.pendingRequest < 0 ) {
+ this.pendingRequest = 0;
+ }
+
+ delete this.pending[ element.name ];
+ }
+ },
+
previousValue: function( element, method ) {
method = typeof method === "string" && method || "remote";
@@ -1570,7 +1595,7 @@ $.extend( $.validator, {
data[ element.name ] = value;
$.ajax( $.extend( true, {
mode: "abort",
- port: "validate" + element.name,
+ port: this.elementAjaxPort( element ),
dataType: "json",
data: data,
context: validator.currentForm,
diff --git a/test/methods.js b/test/methods.js
index fa49939e4..2966ec25f 100644
--- a/test/methods.js
+++ b/test/methods.js
@@ -801,6 +801,36 @@ QUnit.test( "Fix #697: remote validation uses wrong error messages", function( a
} );
} );
+QUnit.test( "Fix #2434: race condition in remote validation rules", function( assert ) {
+ var e = $( "#username" ),
+ done1 = assert.async(),
+ v = $( "#userForm" ).validate( {
+ rules: {
+ username: {
+ required: true,
+ remote: {
+ url: "users.php"
+ }
+ }
+ },
+ messages: {
+ username: {
+ remote: $.validator.format( "{0} in use" )
+ }
+ }
+ } );
+
+ e.val( "Peter" );
+ v.element( e );
+
+ e.val( "" );
+ v.element( e );
+ setTimeout( function() {
+ assert.equal( v.errorList[ 0 ].message, "This field is required." );
+ done1();
+ } );
+} );
+
QUnit.module( "additional methods" );
QUnit.test( "phone (us)", function( assert ) {
From 98fbc5f4287b9e580be6c1404094e9ae31b4abb2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sylvain=20Monn=C3=A9?=
Date: Sun, 17 Jul 2022 13:21:36 +0200
Subject: [PATCH 11/38] Core: remove pending class from fields with an aborted
request (#2436)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Ref #2434
Ref #2435
Co-authored-by: Sylvain Monné
---
src/core.js | 1 +
test/methods.js | 8 ++++++++
2 files changed, 9 insertions(+)
diff --git a/src/core.js b/src/core.js
index 923b3012b..b7c62c04c 100644
--- a/src/core.js
+++ b/src/core.js
@@ -1152,6 +1152,7 @@ $.extend( $.validator, {
}
delete this.pending[ element.name ];
+ $( element ).removeClass( this.settings.pendingClass );
}
},
diff --git a/test/methods.js b/test/methods.js
index 2966ec25f..a65e4b474 100644
--- a/test/methods.js
+++ b/test/methods.js
@@ -822,11 +822,19 @@ QUnit.test( "Fix #2434: race condition in remote validation rules", function( as
e.val( "Peter" );
v.element( e );
+ assert.equal( e.hasClass( "error" ), false, "Field 'username' should not have the error class" );
+ assert.equal( e.hasClass( "pending" ), true, "field 'username' should have the pending class" );
e.val( "" );
v.element( e );
+ assert.equal( v.errorList[ 0 ].message, "This field is required." );
+ assert.equal( e.hasClass( "error" ), true, "Field 'username' should have the error class" );
+ assert.equal( e.hasClass( "pending" ), false, "field 'username' should not have the pending class" );
+
setTimeout( function() {
assert.equal( v.errorList[ 0 ].message, "This field is required." );
+ assert.equal( e.hasClass( "error" ), true, "Field 'username' should have the error class" );
+ assert.equal( e.hasClass( "pending" ), false, "field 'username' should not have the pending class" );
done1();
} );
} );
From f1bb23544bb7a796402b763af115662651aa6dbd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fl=C3=A1vio=20Monteiro?=
Date: Thu, 13 Oct 2022 06:36:37 -0300
Subject: [PATCH 12/38] Localization: Improve required translation in pt_BR
(#2445)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
"É requerido" although correct is weird in this context (it's much more used in formal settings for documents known as requerimentos) and too much of a literal translation. This change aims to improve user-friendliness in this particular message.
---
src/localization/messages_pt_BR.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/localization/messages_pt_BR.js b/src/localization/messages_pt_BR.js
index 996c844be..42cd4a6bd 100644
--- a/src/localization/messages_pt_BR.js
+++ b/src/localization/messages_pt_BR.js
@@ -6,7 +6,7 @@
$.extend( $.validator.messages, {
// Core
- required: "Este campo é requerido.",
+ required: "Este campo é obrigatório.",
remote: "Por favor, corrija este campo.",
email: "Por favor, forneça um endereço de email válido.",
url: "Por favor, forneça uma URL válida.",
From d46e86c1432f449959025b1c41e4cf16eb62a699 Mon Sep 17 00:00:00 2001
From: Jonathan
Date: Fri, 11 Nov 2022 11:40:48 +0100
Subject: [PATCH 13/38] Demo: fix minlength validation in
ajaxSubmit-integration-demo.html (#2454)
---
demo/ajaxSubmit-integration-demo.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/demo/ajaxSubmit-integration-demo.html b/demo/ajaxSubmit-integration-demo.html
index 057f18dbe..21a7d38d9 100644
--- a/demo/ajaxSubmit-integration-demo.html
+++ b/demo/ajaxSubmit-integration-demo.html
@@ -74,7 +74,7 @@
-
+
From 29fb609cd093a7b5eca9ed33668b55765a4fc0b0 Mon Sep 17 00:00:00 2001
From: Saurabh <41580629+saurabhsharma2u@users.noreply.github.com>
Date: Fri, 11 Nov 2022 21:59:31 +0530
Subject: [PATCH 14/38] Localization: Add Hindi translation (#2453)
* Localisation: Update Hindi (India) translation
* Hindi Translation for Step Method
* HIndi-India Local messages for additional method
* file rename as per ISO 639-1 format
* removed duplicate message, causing the test fail
* removed duplicate "cifES" error message
---
src/localization/message_hi.js | 42 ++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
create mode 100644 src/localization/message_hi.js
diff --git a/src/localization/message_hi.js b/src/localization/message_hi.js
new file mode 100644
index 000000000..72bf4a149
--- /dev/null
+++ b/src/localization/message_hi.js
@@ -0,0 +1,42 @@
+/*
+ * Translated default messages for the jQuery validation plugin.
+ * Locale: Hindi; हिंदी
+ */
+$.extend( $.validator.messages, {
+ required: "आवश्यक फ़ील्ड।",
+ remote:"इस फ़ील्ड को जांचें।",
+ email: "एक वैध ई - मेल पते की प्रविष्टि करें।",
+ url: "कृपया एक वैध वेब पता दर्ज करें।",
+ date: "कृपया कोई मान्य दिनांक दर्ज करें।",
+ dateISO: "कृपया एक मान्य दिनांक (ISO) दर्ज करें।",
+ number: "कृपया सही अंक दर्ज करें।",
+ digits: "केवल संख्याएं दर्ज करें।",
+ creditcard: "कृपया एक वैध क्रेडिट कार्ड नंबर डालें।",
+ equalTo: "मेल नहीं खाता।",
+ extension: "कृपया एक मान्य एक्सटेंशन वाला मान दर्ज करें।",
+ maxlength: $.validator.format( "अधिक दर्ज न करें {0} वर्णों में से" ),
+ minlength: $.validator.format( "कृपया कम से कम {0} वर्ण दर्ज करें।" ),
+ rangelength: $.validator.format( "कृपया {0} और {1} वर्णों के बीच एक मान दर्ज करें।" ),
+ range: $.validator.format( "कृपया {0} और {1} के बीच एक मान दर्ज करें।" ),
+ max: $.validator.format( "कृपया {0} से कम या उसके बराबर मान दर्ज करें।" ),
+ min: $.validator.format( "कृपया {0} से अधिक या उसके बराबर मान दर्ज करें।" ),
+ nieES: "कृपया एक मान्य NIE दर्ज करें।",
+ cifES: "कृपया एक मान्य CIF दर्ज करें.",
+ currency: "कृपया एक मान्य मुद्रा दर्ज करें।.",
+ step: $.validator.format( "{0} का गुणज होना चाहिए।" ),
+ abaRoutingNumber:"कृपया एक मान्य रूटिंग नंबर दर्ज करें।",
+ accept:"कृपया एक मान्य माइमटाइप वाला मान दर्ज करें।",
+ alphanumeric:"कृपया, केवल अक्षर, संख्याएं और अंडरस्कोर।",
+ bankaccountNL:"कृपया एक वैध बैंक खाता संख्या निर्दिष्ट करें।",
+ bankorgiroaccountNL:"कृपया एक वैध बैंक या जीरो खाता संख्या निर्दिष्ट करें।",
+ bic:"कृपया कोई मान्य BIC कोड निर्दिष्ट करें।",
+ ziprange:"आपका ज़िप कोड 902xx-xxxx से 905xx-xxxx की सीमा में होना चाहिए।",
+ zipcodeUS:"निर्दिष्ट यूएस ज़िप कोड अमान्य है।",
+ vinUS:"निर्दिष्ट वाहन पहचान संख्या (VIN) अमान्य है।",
+ time12h:"कृपया 12 घंटे पूर्वाह्न/अपराह्न प्रारूप में मान्य समय दर्ज करें।",
+ time:"कृपया 00:00 और 23:59 के बीच एक वैध समय दर्ज करें।",
+ strippedminlength:"कृपया कम से कम {0} वर्ण दर्ज करें।",
+ stateUS:"कृपया एक वैध प्रदेश निर्दिष्ट करें।",
+ skip_or_fill_minimum:"कृपया या तो इन फ़ील्ड को छोड़ दें या उनमें से कम से कम {0} भरें।",
+ require_from_group:"कृपया इनमें से कम से कम {0} को भरें।"
+} );
From 13b859e35735086cb320423b3585d8a6edee4349 Mon Sep 17 00:00:00 2001
From: Warren White <111083379+wewhite@users.noreply.github.com>
Date: Thu, 1 Dec 2022 02:50:24 -0800
Subject: [PATCH 15/38] Additional: vinUS validation fails on valid vin numbers
(#2460)
* Removed === compare, changed to ==
Compare by value and type (===) does not work for this algorithm, as both cd and cdv can be either types at the same time.
By comparing by value only (==) cd and cdv can be either integer or string, as a string number will be converted to a number reqardless of type.
* Rewrote forloop, removed nested forloop
* Additional: fixed spacing issues
* Additional: Add vinUS.js validation test cases
Test cases include default test with 17 one's, and additional US and Canada VIN
* Additional: add two more test casses for vinUS
* Additional: removed text license number, should be VIN
---
src/additional/vinUS.js | 69 ++++++++++++++++++----------------------
test/additional/vinUS.js | 11 +++++++
test/index.html | 1 +
3 files changed, 43 insertions(+), 38 deletions(-)
create mode 100644 test/additional/vinUS.js
diff --git a/src/additional/vinUS.js b/src/additional/vinUS.js
index 15460d725..3fd2d128b 100644
--- a/src/additional/vinUS.js
+++ b/src/additional/vinUS.js
@@ -11,44 +11,37 @@
* @cat Plugins/Validate/Methods
*/
$.validator.addMethod( "vinUS", function( v ) {
- if ( v.length !== 17 ) {
- return false;
- }
+ if ( v.length !== 17 ) {
+ return false;
+ }
- var LL = [ "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" ],
- VL = [ 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 7, 9, 2, 3, 4, 5, 6, 7, 8, 9 ],
- FL = [ 8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2 ],
- rs = 0,
- i, n, d, f, cd, cdv;
+ var LL = [ "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" ],
+ VL = [ 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 7, 9, 2, 3, 4, 5, 6, 7, 8, 9 ],
+ FL = [ 8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2 ],
+ rs = 0,
+ i, n, d, f, cd, cdv;
- for ( i = 0; i < 17; i++ ) {
- f = FL[ i ];
- d = v.slice( i, i + 1 );
- if ( i === 8 ) {
- cdv = d;
- }
- if ( !isNaN( d ) ) {
- d *= f;
- } else {
- for ( n = 0; n < LL.length; n++ ) {
- if ( d.toUpperCase() === LL[ n ] ) {
- d = VL[ n ];
- d *= f;
- if ( isNaN( cdv ) && n === 8 ) {
- cdv = LL[ n ];
- }
- break;
- }
- }
- }
- rs += d;
- }
- cd = rs % 11;
- if ( cd === 10 ) {
- cd = "X";
- }
- if ( cd === cdv ) {
- return true;
- }
- return false;
+ for ( i = 0; i < 17; i++ ) {
+ f = FL[ i ];
+ d = v.slice( i, i + 1 );
+ if ( isNaN( d ) ) {
+ d = d.toUpperCase();
+ n = VL[ LL.indexOf( d ) ];
+ } else {
+ n = parseInt( d, 10 );
+ }
+ if ( i === 8 )
+ {
+ cdv = n;
+ if ( d === "X" ) {
+ cdv = 10;
+ }
+ }
+ rs += n * f;
+ }
+ cd = rs % 11;
+ if ( cd === cdv ) {
+ return true;
+ }
+ return false;
}, "The specified vehicle identification number (VIN) is invalid." );
diff --git a/test/additional/vinUS.js b/test/additional/vinUS.js
new file mode 100644
index 000000000..3311b0111
--- /dev/null
+++ b/test/additional/vinUS.js
@@ -0,0 +1,11 @@
+QUnit.test( "vinUS", function( assert ) {
+ var method = methodTest( "vinUS" );
+ assert.ok( method( "11111111111111111" ), "Valid test VIN number" );
+ assert.ok( method( "1FTFX1CT9CFD06231" ), "Valid US VIN number" );
+ assert.ok( method( "2FTHF26F8SCA68695" ), "Valid CAN VIN number" );
+ assert.ok( method( "LJCPCBLCX11000237" ), "Valid VIN with X check digit" );
+ assert.ok( !method( "LJCPCBLC011000237" ), "Invalid VIN with 0 check digit" );
+ assert.ok( !method( "2FTHF26F8" ), "InValid VIN number" );
+ assert.ok( !method( "11111111X1111111" ), "Invalid test VIN" );
+ assert.ok( !method( "1111111101111111" ), "Invalid test VIN" );
+} );
diff --git a/test/index.html b/test/index.html
index bf22a640a..17c6438b8 100644
--- a/test/index.html
+++ b/test/index.html
@@ -19,6 +19,7 @@
+
From cfe74a19b671b0983b3b13dbf959619cfe926de9 Mon Sep 17 00:00:00 2001
From: Leonardo Spina
Date: Tue, 24 Jan 2023 11:37:07 +0000
Subject: [PATCH 16/38] Core: Call to resetInternals removed in remote
validation callback (#2242)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Core: Call to resetInternals removed in remote validation callback
* Core: Add unit test for issue #2150 fix
* Core: fix code style errors
Co-authored-by: leonardospina
Co-authored-by: Julien Tschäppät
---
src/core.js | 1 -
test/index.html | 4 ++++
test/test.js | 31 +++++++++++++++++++++++++++++++
3 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/src/core.js b/src/core.js
index b7c62c04c..5a2fb1ce4 100644
--- a/src/core.js
+++ b/src/core.js
@@ -1607,7 +1607,6 @@ $.extend( $.validator, {
validator.settings.messages[ element.name ][ method ] = previous.originalMessage;
if ( valid ) {
submitted = validator.formSubmitted;
- validator.resetInternals();
validator.toHide = validator.errorsFor( element );
validator.formSubmitted = submitted;
validator.successList.push( element );
diff --git a/test/index.html b/test/index.html
index 17c6438b8..f27ad1d76 100644
--- a/test/index.html
+++ b/test/index.html
@@ -72,6 +72,10 @@
+