From 2453ce3cb38b85471f4d541ca5e7728b2c56fee7 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 26 Oct 2017 18:27:54 -0400 Subject: [PATCH] strip + validate before hook instead --- src/messaging.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/messaging.js b/src/messaging.js index 932f388fe1..d6339f013f 100644 --- a/src/messaging.js +++ b/src/messaging.js @@ -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,