fix restrictSymbols

This commit is contained in:
Alexey 2020-05-01 13:32:02 +03:00
parent 8e7c2df8b3
commit 525c237b6c

View File

@ -63,8 +63,12 @@ function validateRefferer(req, res, next) {
} }
function restrictSymbols(value) { function restrictSymbols(value) {
const regExpression = new RegExp('[^0-9a-zA-Z\\x20]', 'g') if (value) {
return value.replace(regExpression, '') const regExpression = new RegExp('[^0-9a-zA-Z\\x20]', 'g')
return value.toString().replace(regExpression, '')
} else {
return ''
}
} }
router.get('/connect/:provider', validateProvider, validateRefferer, (req, res) => { router.get('/connect/:provider', validateProvider, validateRefferer, (req, res) => {