expr, 1, -1); // Unescape the outer quote character inside the string to prevent double-escaping in render() $quot = substr($this->expr, 0, 1); $backslash = chr(0) . 'backslash' . chr(0); $this->expr = str_replace(['\\\\', "\\$quot", $backslash], [$backslash, $quot, '\\\\'], $str); } public function render(array $fieldList): string { return '"' . \CRM_Core_DAO::escapeString($this->expr) . '"'; } }