Rescue ArgumentError leaked from the date filter

This monkey-patches a bug in Liquid filed at Shopify/liquid#632.

Fixes #933.

Akinori MUSHA лет %!s(int64=9): %!d(string=назад)
Родитель
Сommit
5271f173ea
1 измененных файлов с 6 добавлено и 0 удалено
  1. 6 0
      app/concerns/liquid_interpolatable.rb

+ 6 - 0
app/concerns/liquid_interpolatable.rb

@@ -218,6 +218,12 @@ module LiquidInterpolatable
218 218
       input.to_s.sub(Regexp.new(regex), unescape_replacement(replacement.to_s))
219 219
     end
220 220
 
221
+    def date(input, format)
222
+      super
223
+    rescue ArgumentError
224
+      input
225
+    end
226
+
221 227
     private
222 228
 
223 229
     def logger