diff --git a/lib/brakeman/processors/lib/render_helper.rb b/lib/brakeman/processors/lib/render_helper.rb index e75f470c5f26177296fb390bd23d2a48bf347a3a..25e4dd984f590cef6c94b5417811ecca1be7b904 100644 --- a/lib/brakeman/processors/lib/render_helper.rb +++ b/lib/brakeman/processors/lib/render_helper.rb @@ -129,6 +129,14 @@ module Brakeman::RenderHelper #TODO: Add in :locals => { ... } to environment src = Brakeman::TemplateAliasProcessor.new(@tracker, template, called_from).process_safely(template[:src], template_env) + digest = Digest::SHA1.new.update(name + src.to_s).to_s.to_sym + + if @tracker.template_cache.include? digest + return + else + @tracker.template_cache << digest + end + #Run alias-processed src through the template processor to pull out #information and outputs. #This information will be stored in tracker.templates, but with a name