From cfe34112a43d27191cb7a6a9f8e0b6e892b87c90 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Sun, 13 Apr 2014 02:06:28 -0500 Subject: [PATCH] Fix emote issues as discussed in #347 --- lib/channel.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/channel.js b/lib/channel.js index 4480a4e7..a4035913 100644 --- a/lib/channel.js +++ b/lib/channel.js @@ -2558,8 +2558,7 @@ Channel.prototype.validateEmote = function (f) { f.image = f.image.substring(0, 1000); f.image = XSS.sanitizeText(f.image); - var s = f.name.replace(/\\\.\?\+\*\$\^\(\)\[\]\{\}/g, "\\$1"); - s = s.replace(/&/g, "&").replace(//g, ">"); + var s = XSS.sanitizeText(f.name).replace(/([\\\.\?\+\*\$\^\(\)\[\]\{\}])/g, "\\$1"); s = "(^|\\s)" + s + "(?!\\S)"; f.source = s;