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>
Cette révision appartient à :
@@ -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
|
||||
{
|
||||
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur