restrict rescue-clause in IncludeTag#render
As it previously enclosed the whole method, it also wrapped file validation errors, which is not meant to be. Fixes #1745.
This commit is contained in:
parent
3888a24068
commit
c5533e9016
|
@ -96,6 +96,7 @@ eos
|
|||
path = File.join(dir, file)
|
||||
validate_file(path, context.registers[:site].safe)
|
||||
|
||||
begin
|
||||
partial = Liquid::Template.parse(source(path, context))
|
||||
|
||||
context.stack do
|
||||
|
@ -105,6 +106,7 @@ eos
|
|||
rescue => e
|
||||
raise IncludeTagError.new e.message, File.join(INCLUDES_DIR, @file)
|
||||
end
|
||||
end
|
||||
|
||||
def validate_dir(dir, safe)
|
||||
if File.symlink?(dir) && safe
|
||||
|
|
Loading…
Reference in New Issue