aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/template/resolver.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/template/resolver.rb')
-rw-r--r--actionpack/lib/action_view/template/resolver.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/template/resolver.rb b/actionpack/lib/action_view/template/resolver.rb
index 7c1636fb60..979be701b2 100644
--- a/actionpack/lib/action_view/template/resolver.rb
+++ b/actionpack/lib/action_view/template/resolver.rb
@@ -132,10 +132,11 @@ module ActionView
def query(path, details, formats)
query = build_query(path, details)
templates = []
- sanitizer = Hash.new { |h,k| h[k] = Dir["#{File.dirname(k)}/*"] }
+ sanitizer = Hash.new { |h,dir| h[dir] = Dir["#{dir}/*"] }
Dir[query].each do |template|
- next if File.directory?(template) || !sanitizer[template].include?(template)
+ next if File.directory?(template)
+ next unless sanitizer[File.dirname(template)].include?(template)
handler, format = extract_handler_and_format(template, formats)
contents = File.binread template