Skip to content

Commit

Permalink
Avoid evaluating the template name in the render tag (#1568)
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanahsmith committed Apr 21, 2022
1 parent 8b68630 commit 36dce29
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/liquid/tags/render.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ def render_to_output_buffer(context, output)
end

def render_tag(context, output)
# Though we evaluate this here we will only ever parse it as a string literal.
template_name = context.evaluate(@template_name_expr)
raise ArgumentError, options[:locale].t("errors.argument.include") unless template_name
# The expression should be a String literal, which parses to a String object
template_name = @template_name_expr
raise ::ArgumentError unless template_name.is_a?(String)

partial = PartialCache.load(
template_name,
Expand Down

0 comments on commit 36dce29

Please sign in to comment.