html-filters: fix base64 filter bytes/str operation mode
This commit is contained in:
parent
83b27e53f1
commit
ea95826723
1 changed files with 3 additions and 3 deletions
|
|
@ -18,8 +18,8 @@
|
|||
# RhodeCode Enterprise Edition, including its added features, Support services,
|
||||
# and proprietary license terms, please see https://rhodecode.com/licenses/
|
||||
|
||||
## base64 filter e.g ${ example | base64,n }
|
||||
# base64 filter e.g ${ example | base64,n }
|
||||
def base64(text):
|
||||
import base64
|
||||
from rhodecode.lib.helpers import safe_str
|
||||
return base64.encodestring(safe_str(text))
|
||||
from rhodecode.lib.helpers import safe_str, safe_bytes
|
||||
return safe_str(base64.encodebytes(safe_bytes(text)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue