From b197163a1d859897ca95af5c19637514ae5f615d Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 28 Mar 2016 19:40:15 +0200 Subject: Core/Commands: Prevent creating accounts containing '@' character with .account create command (cherry picked from commit 4a679ba1be08e9302970cd7dc11fcc70e7fc4c91) --- src/server/scripts/Commands/cs_account.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index 6ffb92d9684..4bce2d168a9 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -121,8 +121,14 @@ public: if (!accountName || !password) return false; - AccountOpResult result = sAccountMgr->CreateAccount(std::string(accountName), std::string(password), email); - switch (result) + if (strchr(accountName, '@')) + { + handler->PSendSysMessage(LANG_ACCOUNT_USE_BNET_COMMANDS); + handler->SetSentErrorMessage(true); + return false; + } + + switch (sAccountMgr->CreateAccount(std::string(accountName), std::string(password), email)) { case AccountOpResult::AOR_OK: handler->PSendSysMessage(LANG_ACCOUNT_CREATED, accountName); -- cgit v1.2.3