Actions
Bug #888
closedservices_dhcp_edit.php - The hostname cannot end with a hyphen according to RFC952
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
09/11/2010
Due date:
% Done:
0%
Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
Affected Architecture:
Description
I have two hosts that have hyphens in them (ex abc-host and def-host). When I tried to add them to the static DHCP leases, I get:
The hostname cannot end with a hyphen according to RFC952 - (note the END, my hyphen is in the middle)
I changed services_dhcp_edit.php from this:
117 preg_match("/.*\-/", $_POST['hostname'], $matches);
to this:
117 preg_match("/.(-)$/", $_POST['hostname'], $matches);
This is the second time I've used a regex so there is probably a better way to do this. I tested the above code change. I can have a hyphen in the middle, but not at the end. Works for me.
Actions