From 342792e3098bbc35f16c084786a74a6097cd940a Mon Sep 17 00:00:00 2001 From: greenkeeperio-bot Date: Mon, 22 Feb 2016 06:51:57 -0800 Subject: [PATCH 1/2] chore(package): update validator to version 5.0.0 http://greenkeeper.io/ --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 44cc1ba861..2c5ac27330 100644 --- a/package.json +++ b/package.json @@ -128,7 +128,7 @@ "thundercats-react": "~0.5.1", "uglify-js": "^2.5.0", "url-regex": "^3.0.0", - "validator": "^4.2.1", + "validator": "^5.0.0", "webpack": "^1.9.12", "webpack-stream": "^3.1.0", "xss-filters": "^1.2.6", From f235dcb38c0de1ce3fc0f86fc447a195d3b467b0 Mon Sep 17 00:00:00 2001 From: Logan Tegman Date: Thu, 25 Feb 2016 11:14:09 -0800 Subject: [PATCH 2/2] Prevent validator being called on non-strings --- common/app/routes/Jobs/components/NewJob.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common/app/routes/Jobs/components/NewJob.jsx b/common/app/routes/Jobs/components/NewJob.jsx index 3683895f71..83aba5ee5b 100644 --- a/common/app/routes/Jobs/components/NewJob.jsx +++ b/common/app/routes/Jobs/components/NewJob.jsx @@ -61,15 +61,15 @@ const checkboxClass = dedent` `; function formatValue(value, validator, type = 'string') { - const formated = getDefaults(type); - if (validator && type === 'string') { - formated.valid = validator(value); + const formatted = getDefaults(type); + if (validator && type === 'string' && typeof value === 'string') { + formatted.valid = validator(value); } if (value) { - formated.value = value; - formated.bsStyle = formated.valid ? 'success' : 'error'; + formatted.value = value; + formatted.bsStyle = formatted.valid ? 'success' : 'error'; } - return formated; + return formatted; } const normalizeOptions = {