Skip to content

Commit c57fd8d

Browse files
authored
Fixes #8640: Incorrect regex used for parsing tree versions (#8644)
1 parent f876223 commit c57fd8d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Classes/TreeTab.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,7 @@ function TreeTabClass:OpenImportPopup()
660660
local function decodeTreeLink(treeLink, newTreeVersion)
661661
-- newTreeVersion is passed in as an output of validateTreeVersion(). It will always be a valid tree version text string
662662
-- 20230908. We always create a new Spec()
663+
ConPrintf("Tree version: " .. newTreeVersion)
663664
local newSpec = new("PassiveSpec", self.build, newTreeVersion)
664665
newSpec.title = controls.name.buf
665666
local errMsg = newSpec:DecodeURL(treeLink)
@@ -734,7 +735,7 @@ function TreeTabClass:OpenImportPopup()
734735
controls.import.enabled = true
735736
return
736737
else
737-
decodeTreeLink(treeLink, validateTreeVersion(treeLink:match("tree/(%w+%-?%w*)"), treeLink:match(versionLookup)))
738+
decodeTreeLink(treeLink, validateTreeVersion(treeLink:match("tree/(%l+%-?%l*)"), treeLink:match(versionLookup)))
738739
end
739740
end)
740741
end
@@ -743,14 +744,14 @@ function TreeTabClass:OpenImportPopup()
743744
elseif treeLink:match("poeskilltree.com/") then
744745
local oldStyleVersionLookup = "/%?v=([0-9]+)%.([0-9]+)%.([0-9]+)%-?%w?%-?%w?#"
745746
-- Strip the version from the tree : https://poeskilltree.com/?v=3.6.0#AAAABAMAABEtfIOFMo6-ksHfsOvu -> https://poeskilltree.com/AAAABAMAABEtfIOFMo6-ksHfsOvu
746-
decodeTreeLink(treeLink:gsub("/%?v=.+#","/"), validateTreeVersion(treeLink:match("%-(%w+%-?%w*)#"), treeLink:match(oldStyleVersionLookup)))
747+
decodeTreeLink(treeLink:gsub("/%?v=.+#","/"), validateTreeVersion(treeLink:match("%-(%l+%-?%l*)#"), treeLink:match(oldStyleVersionLookup)))
747748
else
748749
-- EG: https://www.pathofexile.com/passive-skill-tree/3.15.0/AAAABgMADI6-HwKSwQQHLJwtH9-wTLNfKoP3ES3r5AAA
749750
-- EG: https://www.pathofexile.com/fullscreen-passive-skill-tree/3.15.0/AAAABgMADAQHES0fAiycLR9Ms18qg_eOvpLB37Dr5AAA
750751
-- EG: https://www.pathofexile.com/passive-skill-tree/ruthless/AAAABgAAAAAA (Ruthless doesn't have versions)
751752
-- EG: https://www.pathofexile.com/passive-skill-tree/ruthless-alternate/AAAABgAAAAAA
752753
-- EG: https://www.pathofexile.com/passive-skill-tree/alternate/AAAABgAAAAAA
753-
decodeTreeLink(treeLink, validateTreeVersion(treeLink:match("tree/(%w+%-?%w*)"), treeLink:match(versionLookup)))
754+
decodeTreeLink(treeLink, validateTreeVersion(treeLink:match("tree/(%l+%-?%l*)"), treeLink:match(versionLookup)))
754755
end
755756
end)
756757
controls.import.enabled = false

0 commit comments

Comments
 (0)