mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 04:25:55 +01:00
added check for invalid tags
This commit is contained in:
@@ -148,6 +148,11 @@ process.on('uncaughtException', function(err) {
|
|||||||
|
|
||||||
// Meta Tags
|
// Meta Tags
|
||||||
templateValues.metaTags = defaultMetaTags.concat(options.metaTags || []).map(function(tag) {
|
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) {
|
tag.content = tag.content.replace(/[&<>'"]/g, function(tag) {
|
||||||
return escapeList[tag] || tag;
|
return escapeList[tag] || tag;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user