Fixing ROCPD SQL Inserts with strange text (#825)

* Fixing ROCPD SQL Inserts with strange text

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update generateRocpd.cpp

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Этот коммит содержится в:
Ammar ELWazir
2025-09-03 13:08:40 -05:00
коммит произвёл GitHub
родитель c6669309a1
Коммит fa70fef03d
+4 -1
Просмотреть файл
@@ -329,7 +329,10 @@ insert_value(std::string_view _name, const Tp& _value, TraitT = {})
return sql_insert_value{_name, std::string{"NULL"}};
}
}
return sql_insert_value{_name, fmt::format("'{}'", _value)};
// Sanitize string values before embedding into SQL to escape quotes and remove
// problematic control/separator characters.
auto _sanitized = sanitize_sql_string(std::string{_value});
return sql_insert_value{_name, fmt::format("'{}'", _sanitized)};
}
else
{