mirror of
https://github.com/slawkens/myaac.git
synced 2025-06-23 21:30:14 +02:00
Fix for install warning - min/max length
This commit is contained in:
parent
aad175548a
commit
ea21e27cdc
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user