Raise a Liquid::Error when a non-array is passed into the concat filter.

This commit is contained in:
Dylan Thacker-Smith
2016-03-31 15:47:06 -04:00
parent b3dda384c9
commit 4239c899a4
2 changed files with 5 additions and 3 deletions
+4 -1
View File
@@ -216,6 +216,9 @@ module Liquid
end
def concat(input, array)
unless array.respond_to?(:to_ary)
raise ArgumentError.new("concat filter requires an array argument")
end
InputIterator.new(input).concat(array)
end
@@ -370,7 +373,7 @@ module Liquid
end
def concat(args)
to_a.concat args
to_a.concat(args)
end
def reverse