View Single Post
04/05/22, 09:33 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
>As I understand it SecurePostHook is just a modified method of ZO_PostHook ZOS added for instances where the later was causing "from insecure code" errors.

Yep, correct afaik.

I'm always using SecurePostHook meanwhile "just to be sure" and never had any trouble so far.
If this is correct -> ZOs needs to tell us.

I guess the correct way would be to always use ZO_PostHook until you get issues, or if you are working around the inventory or other "taintable"/"secured" code (there is no list what is potentially secured, afaik, before you ask! ) you should use SecurePostHook.

But intentionally this was designed for e.g. inventory related stuff where the addon code "tainted" the ZOs code before the inventory was fully build-up. There also were other use-cases but this is the one I remember.

btw:
I still ran into issues with that, e.g. if you posthook the PLAYER_INVETORY.inventories[...]list.SetupFunction (or RowSetupFunciton of the scroll list, dunnot the exact function name anymore):
If I used SecurePostHook or ZO_PostHook it still threw me errors later on upon destroying items, or even mouse over or keybind usage.
If I "overwrite" it with my own post hook function it works though...

Last edited by Baertram : 04/05/22 at 09:35 AM.
  Reply With Quote