strip + validate before hook instead

v1.18.x
psychobunny 7 years ago
parent 98eddc78cb
commit 2453ce3cb3

@ -73,13 +73,14 @@ function canGet(hook, callerUid, uid, callback) {
}
Messaging.parse = function (message, fromuid, uid, roomId, isNew, callback) {
message = S(message).stripTags().decodeHTMLEntities().s;
message = validator.escape(String(message));
plugins.fireHook('filter:parse.raw', message, function (err, parsed) {
if (err) {
return callback(err);
}
parsed = S(parsed).stripTags().decodeHTMLEntities().s;
parsed = validator.escape(String(parsed));
var messageData = {
message: message,

Loading…
Cancel
Save