Fix for install warning - min/max length

This commit is contained in:
slawkens 2023-07-22 11:03:59 +02:00
parent aad175548a
commit ea21e27cdc

View File

@ -180,15 +180,16 @@ class Validator
return false;
}
$minLength = setting('core.create_character_name_min_length');
$maxLength = setting('core.create_character_name_max_length');
// installer doesn't know config.php yet
// that's why we need to ignore the nulls
if(is_null($minLength) || is_null($maxLength)) {
if(defined('MYAAC_INSTALL')) {
$minLength = 4;
$maxLength = 21;
}
else {
$minLength = setting('core.create_character_name_min_length');
$maxLength = setting('core.create_character_name_max_length');
}
$length = strlen($name);
if($length < $minLength)
@ -221,16 +222,6 @@ class Validator
return false;
}
$npcCheck = setting('core.create_character_name_npc_check');
if ($npcCheck) {
require_once LIBS . 'npc.php';
NPCS::load();
if(NPCS::$npcs && in_array(strtolower($name), NPCS::$npcs)) {
self::$lastError = "Invalid name format. Do not use NPC Names";
return false;
}
}
return true;
}