barisusakli 11 years ago
parent e8265efc20
commit a400e5de81

@ -11,6 +11,7 @@ var db = require('./database'),
CategoryTools = require('./categoryTools'),
meta = require('./meta'),
emitter = require('./emitter'),
validator = require('validator'),
async = require('async'),
winston = require('winston'),
@ -247,6 +248,8 @@ var db = require('./database'),
for (var i=0; i<categories.length; ++i) {
if (categories[i]) {
categories[i].name = validator.escape(categories[i].name);
categories[i].description = validator.escape(categories[i].description);
categories[i].backgroundImage = categories[i].image ? nconf.get('relative_path') + categories[i].image : '';
categories[i].disabled = categories[i].disabled ? parseInt(categories[i].disabled, 10) !== 0 : false;
}

@ -55,10 +55,6 @@ function filterAndRenderCategories(req, res, next, active) {
return active ? !category.disabled : category.disabled;
});
data.categories.forEach(function(category) {
category.description = validator.escape(category.description);
});
res.render('admin/categories', data);
});
}

Loading…
Cancel
Save