Skip to content

Commit 39f9be1

Browse files
author
Till Brehm
committed
Merge branch '6805-allow-hostnames-in-remote-ip-field-in-mysql-databases' into 'develop'
Resolve "Allow hostnames in remote IP field in MySQL databases" Closes #6805 See merge request ispconfig/ispconfig3!1992
2 parents 462ba38 + 19a3ebd commit 39f9be1

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)