Changed Server Validator to allow hostnames or IPs

pull/480/head
MiX-MaN 2017-06-04 21:05:45 -05:00
parent 50ab06640e
commit 1403751783
1 changed files with 1 additions and 6 deletions

View File

@ -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;