diff options
author | megamage <none@none> | 2008-11-20 16:16:57 -0600 |
---|---|---|
committer | megamage <none@none> | 2008-11-20 16:16:57 -0600 |
commit | 1e997b95cc89c615adf2acd27a5f6916b78e0ff3 (patch) | |
tree | 491c496b798daf9b20db6397ae3f0affb6fd3738 /src/game/GMTicketMgr.h | |
parent | 0b61584e1b19afb8dbef376a4e2903d8631bfc1d (diff) |
Re-commit 262 due to EOL issues. (no difference from 262)
--HG--
branch : trunk
Diffstat (limited to 'src/game/GMTicketMgr.h')
-rw-r--r-- | src/game/GMTicketMgr.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/game/GMTicketMgr.h b/src/game/GMTicketMgr.h index a7b7a02ea17..1fd4e4c3a8f 100644 --- a/src/game/GMTicketMgr.h +++ b/src/game/GMTicketMgr.h @@ -50,7 +50,10 @@ class GMTicket { m_text = text ? text : ""; m_lastUpdate = time(NULL); - CharacterDatabase.PExecute("UPDATE character_ticket SET ticket_text = '%s' WHERE guid = '%u'", m_text.c_str(), m_guid); + + std::string escapedString = m_text; + CharacterDatabase.escape_string(escapedString); + CharacterDatabase.PExecute("UPDATE character_ticket SET ticket_text = '%s' WHERE guid = '%u'", escapedString.c_str(), m_guid); } void DeleteFromDB() const @@ -62,7 +65,11 @@ class GMTicket { CharacterDatabase.BeginTransaction(); DeleteFromDB(); - CharacterDatabase.PExecute("INSERT INTO character_ticket (guid, ticket_text) VALUES ('%u', '%s')", m_guid, GetText()); + + std::string escapedString = m_text; + CharacterDatabase.escape_string(escapedString); + + CharacterDatabase.PExecute("INSERT INTO character_ticket (guid, ticket_text) VALUES ('%u', '%s')", m_guid, escapedString.c_str()); CharacterDatabase.CommitTransaction(); } private: @@ -115,4 +122,4 @@ class GMTicketMgr }; #define ticketmgr Trinity::Singleton<GMTicketMgr>::Instance() -#endif
\ No newline at end of file +#endif |