1
0
mirror of https://github.com/anope/anope.git synced 2026-07-08 15:23:12 +02:00

Modified the SQL API to allow unescaped parameters (useful for passing row names and NULL values)

This commit is contained in:
DukePyrolator
2012-04-08 12:30:48 +02:00
parent 9d249ef96f
commit 9e1fda2a44
2 changed files with 13 additions and 5 deletions
+2 -2
View File
@@ -423,8 +423,8 @@ Anope::string MySQLService::BuildQuery(const SQLQuery &q)
{
Anope::string real_query = q.query;
for (std::map<Anope::string, Anope::string>::const_iterator it = q.parameters.begin(), it_end = q.parameters.end(); it != it_end; ++it)
real_query = real_query.replace_all_cs("@" + it->first + "@", "'" + this->Escape(it->second) + "'");
for (std::map<Anope::string, QueryData>::const_iterator it = q.parameters.begin(), it_end = q.parameters.end(); it != it_end; ++it)
real_query = real_query.replace_all_cs("@" + it->first + "@", (it->second.escape ? ("'" + this->Escape(it->second.data) + "'") : it->second.data));
return real_query;
}