Guard against users putting strings with thousands of periods into custom columns and then saying they are hierarchical

This commit is contained in:
Charles Haley 2013-01-28 20:23:06 +01:00
parent 69a38a51cb
commit 37a725d034

View File

@ -188,12 +188,14 @@ class TagTreeItem(object): # {{{
def child_tags(self): def child_tags(self):
res = [] res = []
def recurse(nodes, res): def recurse(nodes, res, depth):
if depth > 100:
return
for t in nodes: for t in nodes:
if t.type != TagTreeItem.CATEGORY: if t.type != TagTreeItem.CATEGORY:
res.append(t) res.append(t)
recurse(t.children, res) recurse(t.children, res, depth+1)
recurse(self.children, res) recurse(self.children, res, 1)
return res return res
# }}} # }}}