Make all array filters that use filter_array util process empty string and nil correctly

This commit is contained in:
Marco Concetto Rudilosso
2025-04-02 11:01:51 +02:00
parent aa1640035f
commit 035a0db6ab
2 changed files with 22 additions and 1 deletions
+4 -1
View File
@@ -986,8 +986,11 @@ module Liquid
attr_reader :context
def filter_array(input, property, target_value, default_value = [], &block)
if property.nil?
raise_property_error(property)
end
property = Liquid::Utils.to_s(property)
return default_value if property.empty?
ary = InputIterator.new(input, context)
return default_value if ary.empty?