mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-03 09:05:13 -07:00
Add url_decode filter to accompany url_encode
This commit is contained in:
@@ -45,6 +45,10 @@ module Liquid
|
|||||||
CGI.escape(input) unless input.nil?
|
CGI.escape(input) unless input.nil?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def url_decode(input)
|
||||||
|
CGI.unescape(input) rescue input
|
||||||
|
end
|
||||||
|
|
||||||
def slice(input, offset, length = nil)
|
def slice(input, offset, length = nil)
|
||||||
offset = Utils.to_integer(offset)
|
offset = Utils.to_integer(offset)
|
||||||
length = length ? Utils.to_integer(length) : 1
|
length = length ? Utils.to_integer(length) : 1
|
||||||
|
|||||||
Reference in New Issue
Block a user