View Single Post
10-07-18, 08:28 PM   #4
Terenna
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 105
I discovered the source of the taint I was experiencing with the community creation/destruction/joining. In the following function:
Lua Code:
  1. local function AddMessage(self, text, ...)
  2.     --Remove player brackets
  3.     text = text:gsub('|Hplayer:([^%|]+)|h%[([^%]]+)%]|h', '|Hplayer:%1|h%2|h')
  4.     --Remove Away and Busy Tags
  5.     text = text:gsub('<Away>', '')
  6.     text = text:gsub('<Busy>', '')
  7.  
  8.     --Strip yells: says: from chat
  9.     text = text:gsub('|Hplayer:([^%|]+)|h(.+)|h says:', '|Hplayer:%1|h%2|h:')
  10.     text = text:gsub('|Hplayer:([^%|]+)|h(.+)|h yells:', '|Hplayer:%1|h%2|h:')
  11.  
  12.     --Shorten GMotD and change online/offline warnings
  13.     text = text:gsub('Guild Message of the Day:', 'GMotD -')
  14.     text = text:gsub('has come online.', '+')
  15.     text = text:gsub('has gone offline.', '-')
  16.  
  17.     --channel replace (Trade and custom)
  18.     text = text:gsub('|h%[(%d+)%. .-%]|h', '|h%1.|h')
  19.  
  20.     --url search
  21.     text = text:gsub('([wWhH][wWtT][wWtT][%.pP]%S+[^%p%s])', '|cffffffff|Hurl:%1|h[%1]|h|r')
  22.  
  23.     return self.DefaultAddMessage(self, text, ...)
  24. end

the last line
Lua Code:
  1. return self.DefaultAddMessage(self, text, ...)
is causing the taint. I don't doubt that the DefaultSetItemRef line you mentioned could also be causing taint, but none that I've come across yet. The above section I was able to reproduce 10/10 times and 0/10 times when I commented that one line of code out.

You wouldn't by chance know how I could better implement the AddMessage function to change things without causing taint, would you?
  Reply With Quote