summaryrefslogtreecommitdiff
path: root/src/modules/extra
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/extra')
-rw-r--r--src/modules/extra/m_sql.h28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/modules/extra/m_sql.h b/src/modules/extra/m_sql.h
index 2e185d978..519b28f33 100644
--- a/src/modules/extra/m_sql.h
+++ b/src/modules/extra/m_sql.h
@@ -234,21 +234,27 @@ class SQLQuery
static std::string Sanitise(const std::string& crap)
{
- std::string temp = "";
- for (unsigned int q = 0; q < crap.length(); q++)
- {
- if (crap[q] == '\'')
+ std::string temp = "";
+ for (unsigned int q = 0; q < crap.length(); q++)
+ {
+ if (crap[q] == '\'')
{
- temp = temp + "\'";
+ temp += "\\'";
}
- else if (crap[q] == '"')
+ else if (crap[q] == '"')
{
- temp = temp + "\\\"";
+ temp += "\\\"";
}
- else
- temp = temp + crap[q];
- }
- return temp;
+ else if (crap[q] == '\\')
+ {
+ temp += "\\\\";
+ }
+ else
+ {
+ temp += crap[q];
+ }
+ }
+ return temp;
}
};