Skip to content

Commit 19a3ebd

Browse files
author
Till Brehm
committed
Fixes #6805 Allow hostnames in remote IP field in MySQL databases
1 parent 462ba38 commit 19a3ebd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

interface/lib/classes/validate_database.inc.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ function valid_ip_list($field_name, $field_value, $validator) {
4444
$cur_value = trim($cur_value);
4545
$valid = true;
4646
if(function_exists('filter_var')) {
47-
if(!filter_var($cur_value, FILTER_VALIDATE_IP)) {
47+
// value must be either an IP address or hostname
48+
if(!filter_var($cur_value, FILTER_VALIDATE_IP) && !filter_var($cur_value, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)) {
4849
$valid = false;
4950
}
5051
} else return "function filter_var missing <br />\r\n";

0 commit comments

Comments
 (0)