mirror of
https://github.com/forcedotcom/afv-library.git
synced 2026-07-31 04:01:24 +08:00
15 lines
548 B
Python
15 lines
548 B
Python
|
|
"""Canonical SQL-escaping helpers for investigating-agentforce-d360.
|
||
|
|
|
||
|
|
Single source of truth for DC-SQL string-literal escaping. Behavioral contract
|
||
|
|
is fixed — do not change the escape strategy without updating every caller and
|
||
|
|
its tests.
|
||
|
|
"""
|
||
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
|
||
|
|
def _escape_sql_literal(s: str) -> str:
|
||
|
|
"""Double single quotes per DC SQL escaping rule. Handles O'Brien →
|
||
|
|
O''Brien, `'; DROP --` → `''; DROP --` (still harmless because it's
|
||
|
|
wrapped in surrounding single quotes)."""
|
||
|
|
return s.replace("'", "''")
|