mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 09:44:55 +02:00
update validator name check
-added character_name_npc_check to config.php -added npc name check to validator
This commit is contained in:
@@ -221,6 +221,16 @@ class Validator
|
||||
return false;
|
||||
}
|
||||
|
||||
$npcCheck = config('character_name_npc_check');
|
||||
if ($npcCheck) {
|
||||
require 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;
|
||||
}
|
||||
|
||||
@@ -334,6 +344,16 @@ class Validator
|
||||
}
|
||||
}
|
||||
|
||||
$npcCheck = config('character_name_npc_check');
|
||||
if ($npcCheck) {
|
||||
require LIBS . 'npc.php';
|
||||
NPCS::load();
|
||||
if(NPCS::$npcs && in_array($name_lower, NPCS::$npcs)) {
|
||||
self::$lastError = "Invalid name format. Do not use NPC Names";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(strspn($name, "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM- '") != $name_length) {
|
||||
self::$lastError = 'This name contains invalid letters, words or format. Please use only a-Z, - , \' and space.';
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user