mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-19 18:13:45 +02:00
Guard against users putting strings with thousands of periods into custom columns and then saying they are hierarchical
This commit is contained in:
parent
69a38a51cb
commit
37a725d034
1 changed files with 5 additions and 3 deletions
|
|
@ -188,12 +188,14 @@ def recurse(nodes, res):
|
|||
|
||||
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…
Reference in a new issue