summaryrefslogtreecommitdiff
path: root/modules/extra/m_mysql.cpp
diff options
context:
space:
mode:
authorDukePyrolator <DukePyrolator@anope.org>2012-04-08 12:30:48 +0200
committerDukePyrolator <DukePyrolator@anope.org>2012-04-08 12:30:48 +0200
commit9e1fda2a44dee120e26acc6e51fbe779eea97712 (patch)
treeba47ff0354fe3b4302dffc4c7108e5bf26d3048c /modules/extra/m_mysql.cpp
parent9d249ef96f7fa1e6460abb9263417652d7e49c3b (diff)
Modified the SQL API to allow unescaped parameters (useful for passing row names and NULL values)
Diffstat (limited to 'modules/extra/m_mysql.cpp')
-rw-r--r--modules/extra/m_mysql.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/extra/m_mysql.cpp b/modules/extra/m_mysql.cpp
index 138c726d8..e83e78c7c 100644
--- a/modules/extra/m_mysql.cpp
+++ b/modules/extra/m_mysql.cpp
@@ -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;
}