mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Guard against users putting strings with thousands of periods into custom columns and then saying they are hierarchical
This commit is contained in:
commit
822e80ff7f
@ -188,12 +188,14 @@ class TagTreeItem(object): # {{{
|
||||
|
||||
def child_tags(self):
|
||||
res = []
|
||||
def recurse(nodes, res):
|
||||
def recurse(nodes, res, depth):
|
||||
if depth > 100:
|
||||
return
|
||||
for t in nodes:
|
||||
if t.type != TagTreeItem.CATEGORY:
|
||||
res.append(t)
|
||||
recurse(t.children, res)
|
||||
recurse(self.children, res)
|
||||
recurse(t.children, res, depth+1)
|
||||
recurse(self.children, res, 1)
|
||||
return res
|
||||
# }}}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user