mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16:04 +01:00
added new hook for messaging teaser retrieval, and casting input as String before execuring stripTags templates helper
This commit is contained in:
@@ -69,10 +69,10 @@
|
||||
|
||||
helpers.stripTags = function (str) {
|
||||
if (typeof S !== 'undefined') {
|
||||
return S(str).stripTags().s;
|
||||
return S(String(str)).stripTags().s;
|
||||
} else {
|
||||
var S = require('string');
|
||||
return S(str).stripTags().s;
|
||||
return S(String(str)).stripTags().s;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -210,7 +210,9 @@ Messaging.getTeaser = function (uid, roomId, callback) {
|
||||
},
|
||||
function (user, next) {
|
||||
teaser.user = user;
|
||||
next(null, teaser);
|
||||
plugins.fireHook('filter:messaging.getTeaser', { teaser: teaser }, function (err, data) {
|
||||
next(err, data.teaser);
|
||||
});
|
||||
}
|
||||
], callback);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user