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');
|
||||
}
|
||||
break;
|
||||
case 'service':
|
||||
case 'service' or '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 :
|
||||
|
@ -101,11 +101,6 @@ class ServerValidator {
|
|||
throw new \InvalidArgumentException('server_ip_bad_service');
|
||||
}
|
||||
break;
|
||||
case 'ping':
|
||||
if(!filter_var($value, FILTER_VALIDATE_IP)) {
|
||||
throw new \InvalidArgumentException('server_ip_bad_service');
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue