From ea21e27cdcb02ae30cc2a9e18b9810ffd60e3989 Mon Sep 17 00:00:00 2001 From: slawkens Date: Sat, 22 Jul 2023 11:03:59 +0200 Subject: [PATCH] Fix for install warning - min/max length --- system/libs/validator.php | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/system/libs/validator.php b/system/libs/validator.php index ed416ebd..85ab5400 100644 --- a/system/libs/validator.php +++ b/system/libs/validator.php @@ -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; }