fix: improve sanitize_column regex
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
parent
ab577751f2
commit
e6ea045d06
1 changed files with 1 additions and 1 deletions
|
|
@ -2293,7 +2293,7 @@ def _sanitize_column(column_name: str, db_type: str) -> str:
|
|||
def _raise_exception():
|
||||
frappe.throw(_("Invalid field name {0}").format(column_name), frappe.DataError)
|
||||
|
||||
regex = re.compile("^.*[,'();\n].*")
|
||||
regex = re.compile("^.*[,'();\n`].*")
|
||||
if "ifnull" in column_name:
|
||||
if regex.match(column_name):
|
||||
# to avoid and, or
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue