File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -46,11 +46,15 @@ function get_error($errmsg) {
4646 * Validator function for server-ip
4747 */
4848 function check_server_ip ($ field_name , $ field_value , $ validator ) {
49- if ($ _POST ['ip_type ' ] == 'IPv4 ' ) {
49+ 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 ' ) {
5054 if (!filter_var ($ field_value , FILTER_VALIDATE_IP , FILTER_FLAG_IPV4 )) {
5155 return $ this ->get_error ($ validator ['errmsg ' ]);
5256 }
53- } elseif ($ _POST [ ' ip_type ' ] == 'IPv6 ' ) {
57+ } elseif ($ type == 'IPv6 ' ) {
5458 if (!filter_var ($ field_value , FILTER_VALIDATE_IP , FILTER_FLAG_IPV6 )) {
5559 return $ this ->get_error ($ validator ['errmsg ' ]);
5660 }
You can’t perform that action at this time.
0 commit comments