Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. HostnameValidator.php

function HostnameValidator::hasValidTld

1 call to HostnameValidator::hasValidTld()
HostnameValidator::validate in vendor/symfony/validator/Constraints/HostnameValidator.php
Checks if the passed value is valid.

File

vendor/symfony/validator/Constraints/HostnameValidator.php, line 65

Class

HostnameValidator
@author Dmitrii Poddubnyi <dpoddubny@gmail.com>

Namespace

Symfony\Component\Validator\Constraints

Code

private function hasValidTld(string $domain) : bool {
    return str_contains($domain, '.') && !\in_array(substr($domain, strrpos($domain, '.') + 1), self::RESERVED_TLDS, true);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal