Merge pull request #1485 from yashsinghcodes/fix-liquid-quote
[fix]: url-encode and url-decode properly
This commit is contained in:
@@ -288,6 +288,27 @@ def split(base, sep):
|
||||
return base.split(sep)
|
||||
|
||||
|
||||
@shuffle_filters.register
|
||||
def url_encode(base):
|
||||
"""url-encode a string"""
|
||||
try:
|
||||
from urllib import quote
|
||||
except ImportError:
|
||||
from urllib.parse import quote
|
||||
|
||||
return quote(base)
|
||||
|
||||
@shuffle_filters.register
|
||||
def url_decode(base):
|
||||
"""url-decode a string"""
|
||||
try:
|
||||
from urllib import unquote_plus
|
||||
except ImportError:
|
||||
from urllib.parse import unquote_plus
|
||||
|
||||
return unquote_plus(base)
|
||||
|
||||
|
||||
###
|
||||
###
|
||||
###
|
||||
|
||||
Reference in New Issue
Block a user