Prevent parent theme infinite loop
This commit is contained in:
@@ -3,6 +3,10 @@
|
|||||||
class WpTheme < WpItem
|
class WpTheme < WpItem
|
||||||
module Childtheme
|
module Childtheme
|
||||||
|
|
||||||
|
def parent_theme_limit
|
||||||
|
3
|
||||||
|
end
|
||||||
|
|
||||||
def is_child_theme?
|
def is_child_theme?
|
||||||
return true unless @theme_template.nil?
|
return true unless @theme_template.nil?
|
||||||
false
|
false
|
||||||
|
|||||||
@@ -222,7 +222,10 @@ def main
|
|||||||
wp_theme.output(wpscan_options.verbose)
|
wp_theme.output(wpscan_options.verbose)
|
||||||
|
|
||||||
# Check for parent Themes
|
# 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
|
parent = wp_theme.get_parent_theme
|
||||||
puts
|
puts
|
||||||
puts "#{info('[+]')} Detected parent theme: #{parent}"
|
puts "#{info('[+]')} Detected parent theme: #{parent}"
|
||||||
|
|||||||
Reference in New Issue
Block a user