-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes incorrect value validation for step attribute
- Loading branch information
Showing
10 changed files
with
56 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/*! @preserve | ||
* bootbox.js | ||
* version: 5.3.2 | ||
* version: 5.3.3 | ||
* author: Nick Payne <[email protected]> | ||
* license: MIT | ||
* http://bootboxjs.com/ | ||
|
@@ -880,7 +880,7 @@ | |
// @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date#Setting_maximum_and_minimum_dates | ||
if (options.inputType !== 'date') { | ||
if (options.step) { | ||
if (options.step === 'any' || (!isNaN(options.step) && parseInt(options.step) > 0)) { | ||
if (options.step === 'any' || (!isNaN(options.step) && parseFloat(options.step) > 0)) { | ||
input.attr('step', options.step); | ||
} | ||
else { | ||
|
@@ -1346,10 +1346,12 @@ | |
} | ||
else { | ||
if (min !== undefined && isNaN(min)) { | ||
minValid = false; | ||
throw new Error('"min" must be a valid number. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-min for more information.'); | ||
} | ||
|
||
if (max !== undefined && isNaN(max)) { | ||
maxValid = false; | ||
throw new Error('"max" must be a valid number. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-max for more information.'); | ||
} | ||
} | ||
|
@@ -1374,15 +1376,6 @@ | |
return /(\d{4})-(\d{2})-(\d{2})/.test(value); | ||
} | ||
|
||
|
||
// Register the default locale | ||
exports.addLocale('en', { | ||
OK: 'OK', | ||
CANCEL: 'Cancel', | ||
CONFIRM: 'OK' | ||
}); | ||
|
||
|
||
// The Bootbox object | ||
return exports; | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/*! @preserve | ||
* bootbox.js | ||
* version: 5.3.2 | ||
* version: 5.3.3 | ||
* author: Nick Payne <[email protected]> | ||
* license: MIT | ||
* http://bootboxjs.com/ | ||
|
@@ -679,7 +679,7 @@ | |
// @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date#Setting_maximum_and_minimum_dates | ||
if (options.inputType !== 'date') { | ||
if (options.step) { | ||
if (options.step === 'any' || (!isNaN(options.step) && parseInt(options.step) > 0)) { | ||
if (options.step === 'any' || (!isNaN(options.step) && parseFloat(options.step) > 0)) { | ||
input.attr('step', options.step); | ||
} | ||
else { | ||
|
@@ -1145,10 +1145,12 @@ | |
} | ||
else { | ||
if (min !== undefined && isNaN(min)) { | ||
minValid = false; | ||
throw new Error('"min" must be a valid number. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-min for more information.'); | ||
} | ||
|
||
if (max !== undefined && isNaN(max)) { | ||
maxValid = false; | ||
throw new Error('"max" must be a valid number. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-max for more information.'); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/*! @preserve | ||
* bootbox.locales.js | ||
* version: 5.3.2 | ||
* version: 5.3.3 | ||
* author: Nick Payne <[email protected]> | ||
* license: MIT | ||
* http://bootboxjs.com/ | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/** | ||
* bootbox.js 5.3.2 | ||
* bootbox.js 5.3.3 | ||
* | ||
* http://bootboxjs.com/license.txt | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.