protected function RequestMatcher::checkIp

Validates an IP address.

Parameters

string $requestIp:

string $ip:

Return value

boolean True valid, false if not.

1 call to RequestMatcher::checkIp()
RequestMatcher::matches in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestMatcher.php
@api

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestMatcher.php, line 154

Class

RequestMatcher
RequestMatcher compares a pre-defined set of checks against a Request instance.

Namespace

Symfony\Component\HttpFoundation

Code

protected function checkIp($requestIp, $ip) {

  // IPv6 address
  if (false !== strpos($requestIp, ':')) {
    return $this
      ->checkIp6($requestIp, $ip);
  }
  else {
    return $this
      ->checkIp4($requestIp, $ip);
  }
}