API issecurevariable

Determines if the given variable is secure or tainted. Any usage of a tainted variable, be it a function or simply data, will break secure state and prevent further access to Protected functions.

isSecure, taint = issecurevariable([table], variable)

Returns

 * isSecure : "boolean" flag: 1 if variable is secure, nil if it is tainted.
 * taint : string: addon that tainted the variable (possibly nil if not tainted by an addon).

Example 1
local secure = issecurevariable( "JumpOrAscendStart" ); if secure then DEFAULT_CHAT_FRAME:AddMessage("OK! Given variable is secure!"); else DEFAULT_CHAT_FRAME:AddMessage("Given variable tainted. :s"); end

Result

 * JumpOrAscendStart is a protected Blizzard-defined function, thus secure. Calling it will not break secure status.
 * Message "OK! Given variable is secure!" will get displayed in your chat frame.

Example 2
local Old_UnitName = UnitName function UnitName(unit) return Old_UnitName(unit or "player") end local secure = issecurevariable( "UnitName" ); if secure then DEFAULT_CHAT_FRAME:AddMessage("OK! Given variable is secure!"); else DEFAULT_CHAT_FRAME:AddMessage("Given variable tainted. :s"); end

Result

 * UnitName is not a protected Blizzard-defined function, but will still become tainted when hooked.
 * Message "Given variable tainted. :s" will get displayed in your chat frame.