Neos\Neos\Validation\Validator\HostnameValidator::isValid PHP Method

isValid() protected method

Validates if the hostname is valid.
protected isValid ( mixed $hostname ) : void
$hostname mixed The hostname that should be validated
return void
    protected function isValid($hostname)
    {
        $pattern = '/(?=^.{4,253}$)(^((?!-)[a-zA-Z0-9-]{1,63}(?<!-)\\.)*(?!-)[a-zA-Z]{2,63}(?<!-)$)/';
        if ($this->options['ignoredHostnames']) {
            $ignoredHostnames = explode(',', $this->options['ignoredHostnames']);
            if (in_array($hostname, $ignoredHostnames)) {
                return;
            }
        }
        if (!preg_match($pattern, $hostname)) {
            $this->addError('The hostname "%1$s" was not valid.', 1415392993, array($hostname));
        }
    }
HostnameValidator