mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
[Python 3 compatibility] Introduced a separate HTML safe string function
in 'utils' module, earlier the function -'escape(...)' was converting the strings to bytes, and that's reason, it was not working on Python 3.
This commit is contained in:
18
web/pgadmin/utils/html.py
Normal file
18
web/pgadmin/utils/html.py
Normal file
@@ -0,0 +1,18 @@
|
||||
##########################################################################
|
||||
#
|
||||
# pgAdmin 4 - PostgreSQL Tools
|
||||
#
|
||||
# Copyright (C) 2013 - 2016, The pgAdmin Development Team
|
||||
# This software is released under the PostgreSQL Licence
|
||||
#
|
||||
#########################################################################
|
||||
|
||||
"""Utilities for HTML"""
|
||||
|
||||
import cgi
|
||||
|
||||
|
||||
def safe_str(x):
|
||||
return cgi.escape(x).encode(
|
||||
'ascii', 'xmlcharrefreplace'
|
||||
).decode()
|
||||
Reference in New Issue
Block a user