##// END OF EJS Templates
html-filters: fix base64 filter bytes/str operation mode
super-admin -
r5026:df372a66 default
parent child Browse files
Show More
@@ -18,8 +18,8 b''
18 # RhodeCode Enterprise Edition, including its added features, Support services,
18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
20
21 ## base64 filter e.g ${ example | base64,n }
21 # base64 filter e.g ${ example | base64,n }
22 def base64(text):
22 def base64(text):
23 import base64
23 import base64
24 from rhodecode.lib.helpers import safe_str
24 from rhodecode.lib.helpers import safe_str, safe_bytes
25 return base64.encodestring(safe_str(text))
25 return safe_str(base64.encodebytes(safe_bytes(text)))
General Comments 0
You need to be logged in to leave comments. Login now