mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-04-29 18:59:21 +02:00
Fix(creature names): restrict multiword creature names (#474)
* Fix(creature names): restrict multiword creature names
This commit is contained in:
parent
bdb4a862b5
commit
a0c7831f58
11
config.php
11
config.php
File diff suppressed because one or more lines are too long
@ -30,16 +30,20 @@ if (empty($_POST) === false) {
|
|||||||
if (strlen($_POST['name']) < $config['minL'] || strlen($_POST['name']) > $config['maxL']) {
|
if (strlen($_POST['name']) < $config['minL'] || strlen($_POST['name']) > $config['maxL']) {
|
||||||
$errors[] = 'Your character name must be between ' . $config['minL'] . ' - ' . $config['maxL'] . ' characters long.';
|
$errors[] = 'Your character name must be between ' . $config['minL'] . ' - ' . $config['maxL'] . ' characters long.';
|
||||||
}
|
}
|
||||||
// name restriction
|
// name restriction
|
||||||
$resname = explode(" ", $_POST['name']);
|
$resname = explode(" ", $_POST['name']);
|
||||||
foreach($resname as $res) {
|
$username = $_POST['name'];
|
||||||
if(in_array(strtolower($res), $config['invalidNameTags'])) {
|
foreach($resname as $res) {
|
||||||
$errors[] = 'Your username contains a restricted word.';
|
if(in_array(strtolower($res), $config['invalidNameTags'])) {
|
||||||
}
|
$errors[] = 'Your username contains a restricted word.';
|
||||||
else if(strlen($res) == 1) {
|
}
|
||||||
$errors[] = 'Too short words in your name.';
|
if(strlen($res) == 1) {
|
||||||
}
|
$errors[] = 'Too short words in your name.';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if(in_array(strtolower($username), $config['creatureNameTags'])) {
|
||||||
|
$errors[] = 'Your username contains a creature name.';
|
||||||
|
}
|
||||||
// Validate vocation id
|
// Validate vocation id
|
||||||
if (!in_array((int)$_POST['selected_vocation'], $config['available_vocations'])) {
|
if (!in_array((int)$_POST['selected_vocation'], $config['available_vocations'])) {
|
||||||
$errors[] = 'Permission Denied. Wrong vocation.';
|
$errors[] = 'Permission Denied. Wrong vocation.';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user