From b5fbad08c6a38c7eca044d037e76dda8d2f96eef Mon Sep 17 00:00:00 2001 From: "Charles-P. Clermont" Date: Wed, 8 Oct 2025 15:50:33 -0400 Subject: [PATCH] rigid set_attribute in for parsing --- lib/liquid/tags/for.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/liquid/tags/for.rb b/lib/liquid/tags/for.rb index 3182983b..da06d64a 100644 --- a/lib/liquid/tags/for.rb +++ b/lib/liquid/tags/for.rb @@ -104,7 +104,7 @@ module Liquid raise SyntaxError, options[:locale].t("errors.syntax.for_invalid_attribute") end p.consume(:colon) - set_attribute(attribute, p.expression) + set_attribute(attribute, p.expression, safe: true) end p.consume(:end_of_string) end @@ -178,16 +178,16 @@ module Liquid output end - def set_attribute(key, expr) + def set_attribute(key, expr, safe: false) case key when 'offset' @from = if expr == 'continue' :continue else - parse_expression(expr) + parse_expression(expr, safe: safe) end when 'limit' - @limit = parse_expression(expr) + @limit = parse_expression(expr, safe: safe) end end