1) Added extra check in qtLiteral method.
2) Fixed some escaping issues.pull/6563/head
parent
940d190bc8
commit
45b1794941
|
@ -38,7 +38,7 @@ def underscore_escape(text):
|
|||
'>': ">",
|
||||
'"': """,
|
||||
'`': "`",
|
||||
"'": "'"
|
||||
"'": "'"
|
||||
}
|
||||
|
||||
# always replace & first
|
||||
|
@ -63,9 +63,7 @@ def underscore_unescape(text):
|
|||
">": '>',
|
||||
""": '"',
|
||||
"`": '`',
|
||||
"'": "'",
|
||||
"'": "'",
|
||||
""": '"'
|
||||
"'": "'"
|
||||
}
|
||||
|
||||
# always replace & first
|
||||
|
|
|
@ -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 />
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue