Changed Server Validator to allow hostnames or IPs
parent
50ab06640e
commit
1403751783
|
@ -92,7 +92,7 @@ class ServerValidator {
|
||||||
throw new \InvalidArgumentException('server_ip_bad_website');
|
throw new \InvalidArgumentException('server_ip_bad_website');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'service':
|
case 'service' or 'ping':
|
||||||
if(
|
if(
|
||||||
!filter_var($value, FILTER_VALIDATE_IP)
|
!filter_var($value, FILTER_VALIDATE_IP)
|
||||||
// domain regex as per http://stackoverflow.com/questions/106179/regular-expression-to-match-hostname-or-ip-address :
|
// domain regex as per http://stackoverflow.com/questions/106179/regular-expression-to-match-hostname-or-ip-address :
|
||||||
|
@ -101,11 +101,6 @@ class ServerValidator {
|
||||||
throw new \InvalidArgumentException('server_ip_bad_service');
|
throw new \InvalidArgumentException('server_ip_bad_service');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'ping':
|
|
||||||
if(!filter_var($value, FILTER_VALIDATE_IP)) {
|
|
||||||
throw new \InvalidArgumentException('server_ip_bad_service');
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue