Allow ping by hostname
Closing #477 and #480. Co-Authored-By: Matthew <djmixman@users.noreply.github.com> Co-Authored-By: Mircea Chirea <chirea.mircea@gmail.com>pull/590/head
parent
41263a39b0
commit
3c55a353be
|
@ -93,18 +93,11 @@ class ServerValidator {
|
|||
}
|
||||
break;
|
||||
case 'service':
|
||||
if(
|
||||
!filter_var($value, FILTER_VALIDATE_IP)
|
||||
case 'ping':
|
||||
if(!filter_var($value, FILTER_VALIDATE_IP)
|
||||
// domain regex as per http://stackoverflow.com/questions/106179/regular-expression-to-match-hostname-or-ip-address :
|
||||
&& !preg_match("/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])/", $value)
|
||||
) {
|
||||
throw new \InvalidArgumentException('server_ip_bad_service');
|
||||
}
|
||||
break;
|
||||
case 'ping':
|
||||
if(!filter_var($value, FILTER_VALIDATE_IP)) {
|
||||
throw new \InvalidArgumentException('server_ip_bad_service');
|
||||
}
|
||||
){throw new \InvalidArgumentException('server_ip_bad_service');}
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue