make sure validator.escape() receives strings only

This commit is contained in:
barisusakli
2016-08-27 15:45:15 +03:00
parent 431e7dd987
commit 07fe5057e1
20 changed files with 34 additions and 34 deletions

View File

@@ -42,7 +42,7 @@ module.exports = function(Categories) {
return;
}
category.name = validator.escape(category.name || '');
category.name = validator.escape(String(category.name || ''));
category.disabled = category.hasOwnProperty('disabled') ? parseInt(category.disabled, 10) === 1 : undefined;
category.icon = category.icon || 'hidden';
if (category.hasOwnProperty('post_count')) {
@@ -58,7 +58,7 @@ module.exports = function(Categories) {
}
if (category.description) {
category.description = validator.escape(category.description);
category.description = validator.escape(String(category.description));
category.descriptionParsed = category.descriptionParsed || category.description;
}
}