WoW API: issecurevariable

Revision as of 00:10, 4 January 2007 by WoWWiki>N3rf
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

WoW API < issecurevariable

Determinates if given variable or table is secure or "tainted". Any usage of a "tainted" (= non-secure) variable, be it a function or simply data, will break secure state and prevent further access to Protected functions.

issecurevariable()

Parameters

Arguments

[table], variable

Return

nil (tainted) or 1 (secure)

Example 1

local secure = issecurevariable( "JumpOrAscendStart" );
if not ( secure == nil ) then 
 DEFAULT_CHAT_FRAME:AddMessage("OK! Given variable is secure!");
else
 DEFAULT_CHAT_FRAME:AddMessage("Given variable is not secure, doing stuff with it will break secure status. :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

some_variable_not_defined_by_blizzard = "bla39_j!";
local secure = issecurevariable( "some_variable_not_defined_by_blizzard" );
if not ( secure == nil ) then 
 DEFAULT_CHAT_FRAME:AddMessage("OK! Given variable is secure!");
else
 DEFAULT_CHAT_FRAME:AddMessage("Given variable is not secure, doing stuff with it will break secure status. :s");
end

Result

  • Message "Given variable is not secure, doing stuff with it will break secure status. :s" will get displayed in your chat frame.

Notes

  • Seems to always return 1 for nil variables.