Quantcast

FIXED: ChatManager.SendMessage should now properly escape pipe characters

F16Gaming [05-20-12 - 17:41]
FIXED: ChatManager.SendMessage should now properly escape pipe characters
in the message.
Filename
ChatManager.lua
diff --git a/ChatManager.lua b/ChatManager.lua
index f95cb85..d5aa1ec 100644
--- a/ChatManager.lua
+++ b/ChatManager.lua
@@ -108,7 +108,10 @@ end
 function CM:SendMessage(msg, channel, target, isBN)
 	isBN = isBN or false
 	if not self.Settings.LOCAL_ONLY then
-		msg = ("[%s] %s"):format(C.Name, tostring(msg))
+		-- Sanitize message
+		--msg = msg:gsub("|*", "|") -- First make sure every pipe char is alone (This is probably not needed)
+		msg = tostring(msg):gsub("|", "||") -- Escape the pipe characters
+		msg = ("[%s] %s"):format(C.Name, msg)
 		if channel == "SMART" then
 			if GT:IsRaid() then
 				channel = "RAID"