mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 16:35:47 +01:00
strip img tags on topic teaser
This commit is contained in:
@@ -12,6 +12,8 @@ var plugins = require('../plugins');
|
||||
var utils = require('../utils');
|
||||
|
||||
module.exports = function (Topics) {
|
||||
var stripTeaserTags = utils.stripTags.concat(['img']);
|
||||
|
||||
Topics.getTeasers = function (topics, uid, callback) {
|
||||
if (typeof uid === 'function') {
|
||||
winston.warn('[Topics.getTeasers] this usage is deprecated please provide uid');
|
||||
@@ -90,7 +92,7 @@ module.exports = function (Topics) {
|
||||
if (tidToPost[topic.tid]) {
|
||||
tidToPost[topic.tid].index = meta.config.teaserPost === 'first' ? 1 : counts[index];
|
||||
if (tidToPost[topic.tid].content) {
|
||||
tidToPost[topic.tid].content = utils.stripHTMLTags(tidToPost[topic.tid].content, utils.stripTags);
|
||||
tidToPost[topic.tid].content = utils.stripHTMLTags(tidToPost[topic.tid].content, stripTeaserTags);
|
||||
}
|
||||
}
|
||||
return tidToPost[topic.tid];
|
||||
|
||||
Reference in New Issue
Block a user