Merge pull request #484 from daerath/master

* CheckNameFilter minimum surname check incorrect
This commit is contained in:
Akkadius 2016-01-01 00:55:55 -06:00
commit 50a8a3017b

View File

@ -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++)