From 14037517838b6fc5799bc664993fb579af01af6d Mon Sep 17 00:00:00 2001 From: MiX-MaN Date: Sun, 4 Jun 2017 21:05:45 -0500 Subject: [PATCH] Changed Server Validator to allow hostnames or IPs --- src/psm/Util/Server/ServerValidator.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/psm/Util/Server/ServerValidator.php b/src/psm/Util/Server/ServerValidator.php index 819e3e63..278cf0f3 100644 --- a/src/psm/Util/Server/ServerValidator.php +++ b/src/psm/Util/Server/ServerValidator.php @@ -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;