Merge pull request #1866 from superuserx/master

Fixed build_recursive_tree()
This commit is contained in:
jcrew99
2020-02-04 14:41:37 +10:00
committed by GitHub

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