Quantcast

- From Resike to prevent tainting stuff to override the SetPoint calls securely.

HonorGoG [02-21-18 - 04:09]
- From Resike to prevent tainting stuff to override the SetPoint calls securely.
Filename
Titan/TitanMovable.lua
diff --git a/Titan/TitanMovable.lua b/Titan/TitanMovable.lua
index bb3a3fe..5fc3511 100644
--- a/Titan/TitanMovable.lua
+++ b/Titan/TitanMovable.lua
@@ -34,6 +34,19 @@ local TitanPanelAce = LibStub("AceAddon-3.0"):NewAddon("TitanPanel", "AceHook-3.
 --	menuBarTop = 75;
 --end

+--From Resike to prevent tainting stuff to override the SetPoint calls securely.
+hooksecurefunc(FrameRef, "SetPoint", function(self)
+	if self.moving then
+		return
+	end
+	self.moving = true
+	self:SetMovable(true)
+	self:SetUserPlaced(true)
+	self:ClearAllPoints()
+	self:SetPoint("CENTER", UIParent, "CENTER", 0, 0)
+	self:SetMovable(false)
+	self.moving = nil
+end)

 --[[ Titan
 TitanMovable is a local table that is cleared then filled with the frames Titan needs to check and adjust, if necessary, with each 'adjust frame' check.