Merge pull request #1866 from superuserx/master
Fixed build_recursive_tree()
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user