added check for invalid tags

This commit is contained in:
Baris Soner Usakli
2014-02-27 01:43:24 -05:00
parent fb1313ec90
commit b8c089cfaa

View File

@@ -148,6 +148,11 @@ process.on('uncaughtException', function(err) {
// Meta Tags
templateValues.metaTags = defaultMetaTags.concat(options.metaTags || []).map(function(tag) {
if(!tag || !tag.content) {
winston.warn('Invalid meta tag. ' + tag);
return tag;
}
tag.content = tag.content.replace(/[&<>'"]/g, function(tag) {
return escapeList[tag] || tag;
});