Merge branch 'new-dev' into 'master'

Bugfix handling 'mo' (month) unit for duration date format inputs

See merge request fatchan/jschan!191
merge-requests/208/head
Thomas Lynch 4 years ago
commit f42b150500
  1. 2
      helpers/paramconverter.js

@ -91,7 +91,7 @@ module.exports = (req, res, next) => {
if (!groups[key]) {
continue;
}
const mult = +groups[key].substring(0,groups[key].length-1); //remove the d, m, y, etc from end of the value
const mult = +groups[key].replace(/\D+/, ''); //remove the unit
if (Number.isSafeInteger(mult) //if the multiplier is safe int
&& Number.isSafeInteger(mult*timeUtils[key]) //and multiplying it is safe int
&& Number.isSafeInteger((mult*timeUtils[key])+banDuration)) { //and adding it to the total is safe

Loading…
Cancel
Save