mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: escape thumbs, allow robots meta tag
This commit is contained in:
@@ -223,7 +223,7 @@ ajaxify = window.ajaxify || {};
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateTags() {
|
function updateTags() {
|
||||||
var metaWhitelist = ['title', 'description', /og:.+/, /article:.+/].map(function (val) {
|
var metaWhitelist = ['title', 'description', /og:.+/, /article:.+/, 'robots'].map(function (val) {
|
||||||
return new RegExp(val);
|
return new RegExp(val);
|
||||||
});
|
});
|
||||||
var linkWhitelist = ['canonical', 'alternate', 'up'];
|
var linkWhitelist = ['canonical', 'alternate', 'up'];
|
||||||
|
|||||||
@@ -64,7 +64,8 @@ async function getThumbs(set) {
|
|||||||
if (cached !== undefined) {
|
if (cached !== undefined) {
|
||||||
return cached.slice();
|
return cached.slice();
|
||||||
}
|
}
|
||||||
const thumbs = await db.getSortedSetRange(set, 0, -1);
|
let thumbs = await db.getSortedSetRange(set, 0, -1);
|
||||||
|
thumbs = thumbs.map(t => validator.escape(String(t)));
|
||||||
cache.set(set, thumbs);
|
cache.set(set, thumbs);
|
||||||
return thumbs.slice();
|
return thumbs.slice();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user