Merge pull request #483 from daerath/master

* AddReport's who and against strings were not being escaped properly.
This commit is contained in:
Akkadius 2015-12-30 12:05:55 -06:00
commit 45d81b71d6

View File

@ -1564,7 +1564,7 @@ void Database::AddReport(std::string who, std::string against, std::string lines
char *escape_str = new char[lines.size()*2+1];
DoEscapeString(escape_str, lines.c_str(), lines.size());
std::string query = StringFormat("INSERT INTO reports (name, reported, reported_text) VALUES('%s', '%s', '%s')", who.c_str(), against.c_str(), escape_str);
std::string query = StringFormat("INSERT INTO reports (name, reported, reported_text) VALUES('%s', '%s', '%s')", EscapeString(who).c_str(), EscapeString(against).c_str(), escape_str);
QueryDatabase(query);
safe_delete_array(escape_str);
}