We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2ae1eb7 commit 352d6a4Copy full SHA for 352d6a4
1 file changed
interface/lib/classes/validate_server.inc.php
@@ -46,11 +46,15 @@ function get_error($errmsg) {
46
* Validator function for server-ip
47
*/
48
function check_server_ip($field_name, $field_value, $validator) {
49
- if($_POST['ip_type'] == 'IPv4') {
+ global $app;
50
+
51
+ $type=(isset($app->remoting_lib->dataRecord['ip_type']))?$app->remoting_lib->dataRecord['ip_type']:$_POST['ip_type'];
52
53
+ if($type == 'IPv4') {
54
if(!filter_var($field_value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
55
return $this->get_error($validator['errmsg']);
56
}
- } elseif ($_POST['ip_type'] == 'IPv6') {
57
+ } elseif ($type == 'IPv6') {
58
if(!filter_var($field_value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
59
60
0 commit comments