mirror of
https://github.com/EQEmu/Server.git
synced 2026-02-12 04:42:24 +00:00
* CheckNameFilter was enforcing minimum surname length of 3 instead of 4.
* Minor refactoring of CheckNameFilter to eliminate redundant code.
This commit is contained in:
parent
fe61abc3cd
commit
aad1396c73
@ -1183,21 +1183,16 @@ bool Database::CheckNameFilter(const char* name, bool surname)
|
|||||||
{
|
{
|
||||||
std::string str_name = name;
|
std::string str_name = name;
|
||||||
|
|
||||||
if(surname)
|
// the minimum 4 is enforced by the client too
|
||||||
|
if (!name || strlen(name) < 4)
|
||||||
{
|
{
|
||||||
// the minimum 4 is enforced by the client too
|
return false;
|
||||||
if(!name || strlen(name) < 3)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
// Given name length is enforced by the client too
|
||||||
|
if (!surname && strlen(name) > 15)
|
||||||
{
|
{
|
||||||
// the minimum 4 is enforced by the client too
|
return false;
|
||||||
if(!name || strlen(name) < 4 || strlen(name) > 15)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < str_name.size(); i++)
|
for (size_t i = 0; i < str_name.size(); i++)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user