1) Added extra check in qtLiteral method.

2) Fixed some escaping issues.
This commit is contained in:
Akshay Joshi 2023-07-12 15:26:19 +05:30
parent 940d190bc8
commit 45b1794941
3 changed files with 5 additions and 7 deletions

View File

@ -38,7 +38,7 @@ def underscore_escape(text):
'>': ">",
'"': """,
'`': "`",
"'": "'"
"'": "'"
}
# always replace & first
@ -63,9 +63,7 @@ def underscore_unescape(text):
">": '>',
""": '"',
"`": '`',
"'": "'",
"'": "'",
""": '"'
"'": "'"
}
# always replace & first

View File

@ -153,8 +153,7 @@ export function initialize(gettext, url_for, _, pgAdmin, csrfToken, Browser) {
panelTitle = generateTitle(tab_title_placeholder, title_data);
const [panelUrl, panelCloseUrl, db_label] = this.getPanelUrls(transId, panelTitle, parentData, gen);
const escapedTitle = _.escape(panelTitle);
const escapedTitle = _.unescape(panelTitle);
let psqlToolForm = `
<form id="psqlToolForm" action="${panelUrl}" method="post">
<input id="title" name="title" hidden />

View File

@ -279,7 +279,8 @@ class Driver(BaseDriver):
if conn:
try:
if type(conn) != psycopg.Connection:
if type(conn) != psycopg.Connection and \
type(conn) != psycopg.AsyncConnection:
conn = conn.conn
res = psycopg.sql.Literal(value).as_string(conn).strip()
except Exception: