fix: improve sanitize_column regex

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
Akhil Narang 2026-02-06 21:15:20 +05:30
parent ab577751f2
commit e6ea045d06
No known key found for this signature in database
GPG key ID: 9DCC61E211BF645F

View file

@ -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