Node.js based forum software built for the modern web
strip img tags on topic teaser
Barış Soner Uşaklıa9e15ae9d076
diff --git a/src/topics/teaser.js b/src/topics/teaser.jsindex 2827e74d41..28fbeb9a35 100644--- a/src/topics/teaser.js+++ b/src/topics/teaser.js@@ -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];