Fixed build_recursive_tree()

This commit is contained in:
superuserx
2020-01-26 20:11:07 +01:00
parent a038dee9d8
commit 5d5a67e177

View File

@@ -149,15 +149,13 @@ class Modules < BeEF::Extension::AdminUI::HttpController
newinput = cinput.split('/')
newcinput = newinput.shift
if parent.detect {|p| p['text'] == newcinput }.nil?
fldr = {'text' => newcinput, 'cls' => 'folder', 'children' => []}
parent << build_recursive_tree(fldr['children'],newinput)
else
parent.each {|p|
if p['text'] == newcinput
p['children'] = build_recursive_tree(p['children'],newinput)
end
}
end
parent << {'text' => newcinput, 'cls' => 'folder', 'children' => []}
end
parent.each {|p|
if p['text'] == newcinput
p['children'] = build_recursive_tree(p['children'],newinput)
end
}
end
if input.count > 0