Added jail name validation

This commit is contained in:
Jose
2020-05-09 16:05:41 -04:00
parent e6cd90ed09
commit d053566c15
3 changed files with 8 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
======================
Version Description
1.0.48......Added jail name validation.
1.0.47......Cosmetic changes, display notify on success.
1.0.46......Added simple page for quick jail config, cosmetic changes.
1.0.45......Minor cosmetic changes.

View File

@@ -100,6 +100,12 @@ if ($_POST):
// Input validation.
// Perform some simple validations for now.
if(isset($_POST['jname']) && ($pconfig['jname'])):
if(!preg_match('/^[A-Za-z0-9-_]+$/D', $pconfig['jname'])):
$input_errors[] = gtext("A valid jail name must be specified.");
endif;
endif;
if(isset($_POST['hostname']) && ($pconfig['hostname'])):
if(preg_match('/\s/', $pconfig['hostname'])):
$input_errors[] = gtext("A valid hostname must be specified.");

View File

@@ -1 +1 @@
1.0.47
1.0.48