Skip to content

Commit 8fe383e

Browse files
authored
Fix infinitely nested XML stored as importLink (#8066)
1 parent 9c92a3c commit 8fe383e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Classes/ImportTab.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,12 @@ You can get this from your web browser's cookies while logged into the Path of E
297297
if self.controls.importCodeMode.selIndex == 1 then
298298
main:OpenConfirmPopup("Build Import", colorCodes.WARNING.."Warning:^7 Importing to the current build will erase ALL existing data for this build.", "Import", function()
299299
self.build:Shutdown()
300-
self.build:Init(self.build.dbFileName, self.build.buildName, self.importCodeXML, false, self.controls.importCodeIn.buf)
300+
self.build:Init(self.build.dbFileName, self.build.buildName, self.importCodeXML, false, self.importCodeSite and self.controls.importCodeIn.buf or nil)
301301
self.build.viewMode = "TREE"
302302
end)
303303
else
304304
self.build:Shutdown()
305-
self.build:Init(false, "Imported build", self.importCodeXML, false, self.controls.importCodeIn.buf)
305+
self.build:Init(false, "Imported build", self.importCodeXML, false, self.importCodeSite and self.controls.importCodeIn.buf or nil)
306306
self.build.viewMode = "TREE"
307307
end
308308
end
@@ -382,6 +382,8 @@ function ImportTabClass:Save(xml)
382382
if self.build.importLink then
383383
xml.attrib.importLink = self.build.importLink
384384
end
385+
-- Gets rid of erroneous, potentially infinitely nested full base64 XML stored as an import link
386+
xml.attrib.importLink = (xml.attrib.importLink and xml.attrib.importLink:len() < 100) and xml.attrib.importLink or nil
385387
end
386388

387389
function ImportTabClass:Draw(viewPort, inputEvents)

0 commit comments

Comments
 (0)