diff --git a/interface/lib/classes/validate_server.inc.php b/interface/lib/classes/validate_server.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..6361fb471ce063867cbbe1e8bcc267ed56e7dd92
--- /dev/null
+++ b/interface/lib/classes/validate_server.inc.php
@@ -0,0 +1,61 @@
+tform->wordbook[$errmsg])) {
+ return $app->tform->wordbook[$errmsg]."
\r\n";
+ } else {
+ return $errmsg."
\r\n";
+ }
+ }
+
+ /**
+ * Validator function for server-ip
+ */
+ function check_server_ip($field_name, $field_value, $validator) {
+ if($_POST['ip_type'] == 'IPv4') {
+ if(!filter_var($field_value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
+ return $this->get_error($validator['errmsg']);
+ }
+ } elseif ($_POST['ip_type'] == 'IPv6') {
+ if(!filter_var($field_value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
+ return $this->get_error($validator['errmsg']);
+ }
+ } else return $this->get_error($validator['errmsg']);
+ }
+
+}
+
diff --git a/interface/web/admin/form/server_ip.tform.php b/interface/web/admin/form/server_ip.tform.php
index 0dbdfe190d12c81540e31a24cdb31fdd2ef4c594..49a59de1623dedb83af3a5a041191bbc8c13dc65 100644
--- a/interface/web/admin/form/server_ip.tform.php
+++ b/interface/web/admin/form/server_ip.tform.php
@@ -121,7 +121,7 @@ $form["tabs"]['server_ip'] = array (
'ip_address' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
- 'validators' => array ( 0 => array ( 'type' => 'ISIP',
+ 'validators' => array ( 0 => array ( 'type' => 'CUSTOME', 'class' => 'validate_server', 'function' => 'check_server_ip',
'errmsg'=> 'ip_error_wrong'),
1 => array ( 'type' => 'UNIQUE',
'errmsg'=> 'ip_error_unique'),
diff --git a/interface/web/admin/form/server_ip_map.tform.php b/interface/web/admin/form/server_ip_map.tform.php
index fb61022ad2cd77fed5ed7235155ac2a991ba89f9..4f7ed3d28c55e3744605d2d390da8e0eeec1006a 100644
--- a/interface/web/admin/form/server_ip_map.tform.php
+++ b/interface/web/admin/form/server_ip_map.tform.php
@@ -69,7 +69,7 @@ $form["tabs"]['server_ip_map'] = array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'validators' => array (
- 0 => array ( 'type' => 'ISIP', 'errmsg'=> 'ip_error_wrong'),
+ 0 => array ( 'type' => 'ISIPV4', 'errmsg'=> 'ip_error_wrong'),
1 => array ( 'type' => 'NOTEMPTY', 'errmsg'=> 'destination_ip_empty'),
),
'default' => '',
diff --git a/server/plugins-available/network_settings_plugin.inc.php b/server/plugins-available/network_settings_plugin.inc.php
index 13dbf3c8c1f0595515b72b1f211e2217f79d2e0c..5ce6f934b810c64148b997690f57fc4263b41f9c 100644
--- a/server/plugins-available/network_settings_plugin.inc.php
+++ b/server/plugins-available/network_settings_plugin.inc.php
@@ -110,7 +110,7 @@ class network_settings_plugin {
/*
* don't insert the main-ip again!
*/
- if ($rec['ip_address'] != $server_config['ip_address'])
+ if ($rec['ip_address'] != $server_config['ip_address'] && filter_var($rec['ip_address'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4))
{
$ip_records[$n] = array(
'id' => $n,
@@ -188,7 +188,7 @@ class network_settings_plugin {
/*
* don't insert the main-ip again!
*/
- if ($rec['ip_address'] != $server_config['ip_address'])
+ if ($rec['ip_address'] != $server_config['ip_address'] && filter_var($rec['ip_address'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4))
{
$ip_records[$n] = array(
'id' => $n,