Revert some freezes on non-literals

This commit is contained in:
Florian Weingarten
2014-01-27 14:56:07 -05:00
parent 43ac8d560b
commit 0a7de51e2b
6 changed files with 12 additions and 12 deletions
+3 -3
View File
@@ -51,13 +51,13 @@ module Liquid
def read_template_file(template_path, context)
full_path = full_path(template_path)
raise FileSystemError, "No such template '#{template_path}'".freeze unless File.exists?(full_path)
raise FileSystemError, "No such template '#{template_path}'" unless File.exists?(full_path)
File.read(full_path)
end
def full_path(template_path)
raise FileSystemError, "Illegal template name '#{template_path}'".freeze unless template_path =~ /^[^.\/][a-zA-Z0-9_\/]+$/
raise FileSystemError, "Illegal template name '#{template_path}'" unless template_path =~ /^[^.\/][a-zA-Z0-9_\/]+$/
full_path = if template_path.include?('/'.freeze)
File.join(root, File.dirname(template_path), @pattern % File.basename(template_path))
@@ -65,7 +65,7 @@ module Liquid
File.join(root, @pattern % template_path)
end
raise FileSystemError, "Illegal template path '#{File.expand_path(full_path)}'".freeze unless File.expand_path(full_path) =~ /^#{File.expand_path(root)}/
raise FileSystemError, "Illegal template path '#{File.expand_path(full_path)}'" unless File.expand_path(full_path) =~ /^#{File.expand_path(root)}/
full_path
end