You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
today I needed a default filter to use in all variables (in this case the :escape filter to prevent XSS), but I have not found how to do this in liquid template, so I make this monkey patch:
module Liquid
class Variable
origin_initialize = instance_method(:initialize)
define_method(:initialize) do |markup|
origin_initialize.bind(self).(markup)
@filters << [:escape, []]
end
end
end
there are some way to do this without this ugly patch???
thx
The text was updated successfully, but these errors were encountered:
Hi,
today I needed a default filter to use in all variables (in this case the :escape filter to prevent XSS), but I have not found how to do this in liquid template, so I make this monkey patch:
there are some way to do this without this ugly patch???
thx
The text was updated successfully, but these errors were encountered: