mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-11 01:48:07 +00:00
Comply with Xiphoseer required changes.
Remove the CDClientDatabase::ExecuteQueryWithArgs() function and replace it with CDClientDatabase::CreatePreppedStmt(). This prevents a developer from accidently using %s, or incorrectly passing std::string, and causing a silent error.
This commit is contained in:
@@ -43,15 +43,7 @@ namespace CDClientDatabase {
|
||||
//! Queries the CDClient and parses arguments
|
||||
/*!
|
||||
\param query The query with formatted arguments
|
||||
\return the results of the query
|
||||
\return prepared SQLite Statement
|
||||
*/
|
||||
// Due to the template, implementation must be in the header.
|
||||
template <typename... Args>
|
||||
CppSQLite3Query ExecuteQueryWithArgs(const std::string& query, Args... args) {
|
||||
CppSQLite3Buffer sqlBuf;
|
||||
sqlBuf.format(query.c_str(), args...);
|
||||
|
||||
std::string safe_query = (const char *) sqlBuf;
|
||||
return ExecuteQuery(safe_query);
|
||||
}
|
||||
CppSQLite3Statement CreatePreppedStmt(const std::string& query);
|
||||
};
|
||||
|
Reference in New Issue
Block a user