View Single Post
10-25-17, 05:36 PM   #7
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 431
Originally Posted by thomasjohnshannon View Post
Has anyone else noticed an error when you /camp if you have an addon with a SlashCmdList loaded?
Yes. They forgot to add the slash handlers for logout and quit to the secure command hash table. The table is populated with all the existing SecureCmdList functions, but logout and quit are declared afterwards with the rest of the unprotected functions.
Lua Code:
  1. -- starting at line 1584
  2. -- Pre-populate the secure command hash table
  3. for index, value in pairs(SecureCmdList) do
  4.     local i = 1;
  5.     local cmdString = _G["SLASH_"..index..i];
  6.     while ( cmdString ) do
  7.         cmdString = strupper(cmdString);
  8.         hash_SecureCmdList[cmdString] = value;  -- add to hash
  9.         i = i + 1;
  10.         cmdString = _G["SLASH_"..index..i];
  11.     end
  12. end

Lua Code:
  1. -- starting at line 1700
  2. SlashCmdList["LOGOUT"] = function(msg)
  3.     Logout();
  4. end
  5.  
  6. SlashCmdList["QUIT"] = function(msg)
  7.     if (IsKioskModeEnabled()) then
  8.         return;
  9.     end
  10.     Quit();
  11. end

This should be reported as a bug.
__________________

Last edited by MunkDev : 10-26-17 at 05:59 PM.
  Reply With Quote