As suggested on wow-europe's forums, I've checked the taint log. Basically, what gets tainted when I hook GetItemInfo is the "/cast" and "/castrandom" actions. In fact, their code is (I think this is the last live version, I haven't checked WDN for test updates though):
Code:
SecureCmdList["CAST"] = function(msg)
local action, target = SecureCmdOptionParse(msg);
if ( action ) then
local name, bag, slot = SecureCmdItemParse(action);
if ( slot or GetItemInfo(name) ) then
SecureCmdUseItem(name, bag, slot, target);
else
CastSpellByName(action, target);
end
end
end
SecureCmdList["USE"] = SecureCmdList["CAST"];
and
Code:
SecureCmdList["CASTRANDOM"] = function(msg)
local actions, target = SecureCmdOptionParse(msg);
if ( actions ) then
local action = strtrim(GetRandomArgument(strsplit(",", actions)));
local name, bag, slot = SecureCmdItemParse(action);
if ( slot or GetItemInfo(name) ) then
SecureCmdUseItem(name, bag, slot, target);
else
CastSpellByName(action, target);
end
end
end
SecureCmdList["USERANDOM"] = SecureCmdList["CASTRANDOM"];
It is really disappointing. This function that returns 10 values is here used only to check if a string matches the name of an item in cache. Because of that, the function cannot be hooked.
Considering the cost of the addition of something like SecureItemExists and the replacement of the occurrences of GetItemInfo in ChatFrame.lua's secured cast functions, I wonder if I should post about this in the "Wish List" board. Do you think that it's worth it, and do you think that it could be applied? Or is there any drawback to this suggestion?