Add url_decode filter to accompany url_encode

This commit is contained in:
Larry Archer
2015-10-21 01:58:22 -04:00
committed by Justin Li
parent 89ccdabe9a
commit 04381418d3
+4
View File
@@ -45,6 +45,10 @@ module Liquid
CGI.escape(input) unless input.nil?
end
def url_decode(input)
CGI.unescape(input) rescue input
end
def slice(input, offset, length = nil)
offset = Utils.to_integer(offset)
length = length ? Utils.to_integer(length) : 1