summaryrefslogtreecommitdiffstats
path: root/usr/local/www/services_dhcp_edit.php
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local/www/services_dhcp_edit.php')
-rwxr-xr-xusr/local/www/services_dhcp_edit.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr/local/www/services_dhcp_edit.php b/usr/local/www/services_dhcp_edit.php
index 51da0f4..cccbd2a 100755
--- a/usr/local/www/services_dhcp_edit.php
+++ b/usr/local/www/services_dhcp_edit.php
@@ -111,6 +111,12 @@ if ($_POST) {
$_POST['mac'] = strtolower(str_replace("-", ":", $_POST['mac']));
if ($_POST['hostname']) {
+ preg_match("/^[0-9]/", $_POST['hostname'], $matches);
+ if($matches)
+ $input_errors[] = gettext("The hostname cannot start with a numeric character according to RFC952");
+ preg_match("/\-\$/", $_POST['hostname'], $matches);
+ if($matches)
+ $input_errors[] = gettext("The hostname cannot end with a hyphen according to RFC952");
if (!is_hostname($_POST['hostname'])) {
$input_errors[] = gettext("The hostname can only contain the characters A-Z, 0-9 and '-'.");
} else {
@@ -251,4 +257,4 @@ include("head.inc");
</form>
<?php include("fend.inc"); ?>
</body>
-</html>
+</html> \ No newline at end of file
OpenPOWER on IntegriCloud