mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 13:30:06 +00:00
Fix enter key sending '\n' in passwords
This commit is contained in:
parent
c1941654b6
commit
7c5d7a70cc
@ -112,6 +112,11 @@ void CNLoginServer::login(CNSocket* sock, CNPacketData* data) {
|
|||||||
userPassword = std::string(U16toU8(login->szPassword).c_str());
|
userPassword = std::string(U16toU8(login->szPassword).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// the client inserts a "\n" in the password if you press enter key in the middle of the password
|
||||||
|
// (not at the start or the end of the password field)
|
||||||
|
if (int(userPassword.find("\n")) > 0)
|
||||||
|
userPassword.erase(userPassword.find("\n"), 1);
|
||||||
|
|
||||||
// check regex
|
// check regex
|
||||||
if (!CNLoginServer::isLoginDataGood(userLogin, userPassword))
|
if (!CNLoginServer::isLoginDataGood(userLogin, userPassword))
|
||||||
return loginFail(LoginError::LOGIN_ERROR, userLogin, sock);
|
return loginFail(LoginError::LOGIN_ERROR, userLogin, sock);
|
||||||
|
Loading…
Reference in New Issue
Block a user