mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-18 10:20:43 -07:00
date filter gracefully accepts empty string
This commit is contained in:
@@ -310,7 +310,10 @@ module Liquid
|
||||
def to_date(obj)
|
||||
return obj if obj.respond_to?(:strftime)
|
||||
|
||||
obj = obj.downcase if obj.is_a?(String)
|
||||
if obj.is_a?(String)
|
||||
return nil if obj.empty?
|
||||
obj = obj.downcase
|
||||
end
|
||||
|
||||
case obj
|
||||
when 'now'.freeze, 'today'.freeze
|
||||
|
||||
Reference in New Issue
Block a user