From 36dce297761d7b23e0fd71d1e4f3fda5e83b2556 Mon Sep 17 00:00:00 2001 From: Dylan Thacker-Smith Date: Thu, 21 Apr 2022 16:10:42 -0400 Subject: [PATCH] Avoid evaluating the template name in the render tag (#1568) --- lib/liquid/tags/render.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/liquid/tags/render.rb b/lib/liquid/tags/render.rb index 6380249c..9b838184 100644 --- a/lib/liquid/tags/render.rb +++ b/lib/liquid/tags/render.rb @@ -34,9 +34,9 @@ module Liquid 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,