diff --git a/src/opnsense/mvc/app/models/OPNsense/Interfaces/Vlan.php b/src/opnsense/mvc/app/models/OPNsense/Interfaces/Vlan.php index b77016e76..1c0101c5f 100644 --- a/src/opnsense/mvc/app/models/OPNsense/Interfaces/Vlan.php +++ b/src/opnsense/mvc/app/models/OPNsense/Interfaces/Vlan.php @@ -53,12 +53,19 @@ class Vlan extends BaseModel break; } elseif (!(strpos((string)$node, (string)$prefix) === 0)) { $messages->appendMessage(new Message( - sprintf(gettext("device name does not match type (e.g. %s_xxx)."), (string)$prefix), + sprintf(gettext("Device name does not match type (e.g. %s0XXX)."), (string)$prefix), $key )); - } elseif (!preg_match("/^([a-zA-Z0-9_]){1,16}$/", (string)$node)) { + } elseif (!preg_match("/^{$prefix}0([0-9\.]){1,16}$/", (string)$node)) { $messages->appendMessage(new Message( - gettext("Invalid device name, only up to 16 alphanumeric characters are supported."), + sprintf( + gettext( + "A maximum of 16 characters is allowed starting with %s0 combined with ". + "numeric characters and dots[.], e.g. (%s.1.104)" + ), + $prefix, + $prefix + ), $key )); }