mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Reject alias names that are too long. Fixes #1510
This commit is contained in:
parent
dfa6dedad7
commit
bac9941b5e
@ -473,8 +473,7 @@ function is_validaliasname($name) {
|
||||
$reserved = array("port", "pass");
|
||||
if (in_array($name, $reserved, true))
|
||||
return; /* return NULL */
|
||||
|
||||
if (!preg_match("/[^a-zA-Z0-9_]/", $name))
|
||||
if (!preg_match("/[^a-zA-Z0-9_]/", $name) && (strlen($name) < 32))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
||||
@ -142,7 +142,7 @@ if ($_POST) {
|
||||
$input_errors[] = gettext("Reserved word used for alias name.");
|
||||
} else {
|
||||
if (is_validaliasname($_POST['name']) == false)
|
||||
$input_errors[] = gettext("The alias name may only consist of the characters") . " a-z, A-Z, 0-9, _.";
|
||||
$input_errors[] = gettext("The alias name must be less than 32 characters long and may only consist of the characters") . " a-z, A-Z, 0-9, _.";
|
||||
}
|
||||
/* check for name conflicts */
|
||||
if (empty($a_aliases[$id])) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user