WoW:API issecurevariable: Difference between revisions

second return value
m (I played around with this a little bit and this is what I got. :))
(second return value)
Line 2: Line 2:
Determines if given variable or table is [[secure]] or "[[Tainted (Addons)|tainted]]." Any usage of a "[[Tainted (Addons)|tainted]]" (= non-secure) variable, be it a function or simply data, will break [[secure]] state and prevent further access to Protected functions.
Determines if given variable or table is [[secure]] or "[[Tainted (Addons)|tainted]]." Any usage of a "[[Tainted (Addons)|tainted]]" (= non-secure) variable, be it a function or simply data, will break [[secure]] state and prevent further access to Protected functions.


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


==Parameters==
==Returns==
===Arguments===
;isSecure : "boolean" flag: 1 if variable is secure, nil if it is tainted.
:;[table], variable
;taint : string: addon that tainted the variable (possibly nil if not tainted by an addon).
 
===Return===
:;isSecure - 1 (secure) or nil (not secure)
:;unknown - always nil. If isSecure is nil, this is not returned (implied nil).


==Example 1==
==Example 1==
Line 35: Line 31:
  end
  end
===Result===
===Result===
*[[API_UnitName|UnitName]] is not a protected Blizzard-defined function, but will still become tainted when hooked.
* [[API_UnitName|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.
* Message "Given variable tainted. :s" will get displayed in your chat frame.


==Notes==
==Notes==