Prevent parent theme infinite loop

This commit is contained in:
ethicalhack3r
2014-12-02 16:40:18 +01:00
parent 91a01265e5
commit d230221999
2 changed files with 8 additions and 1 deletions

View File

@@ -3,6 +3,10 @@
class WpTheme < WpItem
module Childtheme
def parent_theme_limit
3
end
def is_child_theme?
return true unless @theme_template.nil?
false

View File

@@ -222,7 +222,10 @@ def main
wp_theme.output(wpscan_options.verbose)
# Check for parent Themes
while wp_theme.is_child_theme?
parent_theme_count = 0
while wp_theme.is_child_theme? && parent_theme_count <= wp_theme.parent_theme_limit
parent_theme_count += 1
parent = wp_theme.get_parent_theme
puts
puts "#{info('[+]')} Detected parent theme: #{parent}"