Open Journal Systems  3.3.0
Symfony\Component\HttpFoundation\IpUtils Class Reference

Static Public Member Functions

static anonymize (string $ip)
 
static checkIp ($requestIp, $ips)
 
static checkIp ($requestIp, $ips)
 
static checkIp4 ($requestIp, $ip)
 
static checkIp4 ($requestIp, $ip)
 
static checkIp6 ($requestIp, $ip)
 
static checkIp6 ($requestIp, $ip)
 

Detailed Description

Http utility functions.

Author
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com

Definition at line 19 of file lib/vendor/symfony/http-foundation/IpUtils.php.

Member Function Documentation

◆ anonymize()

static Symfony\Component\HttpFoundation\IpUtils::anonymize ( string  $ip)
static

Anonymizes an IP/IPv6.

Removes the last byte for v4 and the last 8 bytes for v6 IPs

Definition at line 162 of file vendor/symfony/http-foundation/IpUtils.php.

◆ checkIp() [1/2]

static Symfony\Component\HttpFoundation\IpUtils::checkIp (   $requestIp,
  $ips 
)
static

Checks if an IPv4 or IPv6 address is contained in the list of given IPs or subnets.

Parameters
string$requestIpIP to check
string | array$ipsList of IPs or subnets (can be a string if only a single one)
Returns
bool Whether the IP is valid

Definition at line 38 of file vendor/symfony/http-foundation/IpUtils.php.

◆ checkIp() [2/2]

static Symfony\Component\HttpFoundation\IpUtils::checkIp (   $requestIp,
  $ips 
)
static

Checks if an IPv4 or IPv6 address is contained in the list of given IPs or subnets.

Parameters
string$requestIpIP to check
string | array$ipsList of IPs or subnets (can be a string if only a single one)
Returns
bool Whether the IP is valid

Definition at line 38 of file lib/vendor/symfony/http-foundation/IpUtils.php.

Referenced by Symfony\Component\HttpFoundation\Request\isFromTrustedProxy(), Symfony\Component\HttpFoundation\RequestMatcher\matches(), Symfony\Component\HttpFoundation\Tests\IpUtilsTest\testAnIpv6WithOptionDisabledIpv6(), Symfony\Component\HttpFoundation\Tests\IpUtilsTest\testIpv4(), and Symfony\Component\HttpFoundation\Tests\IpUtilsTest\testIpv6().

◆ checkIp4() [1/2]

static Symfony\Component\HttpFoundation\IpUtils::checkIp4 (   $requestIp,
  $ip 
)
static

Compares two IPv4 addresses. In case a subnet is given, it checks if it contains the request IP.

Parameters
string$requestIpIPv4 address to check
string$ipIPv4 address or subnet in CIDR notation
Returns
bool Whether the request IP matches the IP, or whether the request IP is within the CIDR subnet

Definition at line 64 of file vendor/symfony/http-foundation/IpUtils.php.

◆ checkIp4() [2/2]

static Symfony\Component\HttpFoundation\IpUtils::checkIp4 (   $requestIp,
  $ip 
)
static

Compares two IPv4 addresses. In case a subnet is given, it checks if it contains the request IP.

Parameters
string$requestIpIPv4 address to check
string$ipIPv4 address or subnet in CIDR notation
Returns
bool Whether the request IP matches the IP, or whether the request IP is within the CIDR subnet

Definition at line 64 of file lib/vendor/symfony/http-foundation/IpUtils.php.

◆ checkIp6() [1/2]

static Symfony\Component\HttpFoundation\IpUtils::checkIp6 (   $requestIp,
  $ip 
)
static

Compares two IPv6 addresses. In case a subnet is given, it checks if it contains the request IP.

Author
David Soria Parra <dsp at php dot net>
See also
https://github.com/dsp/v6tools
Parameters
string$requestIpIPv6 address to check
string$ipIPv6 address or subnet in CIDR notation
Returns
bool Whether the IP is valid
Exceptions

Definition at line 108 of file lib/vendor/symfony/http-foundation/IpUtils.php.

◆ checkIp6() [2/2]

static Symfony\Component\HttpFoundation\IpUtils::checkIp6 (   $requestIp,
  $ip 
)
static

Compares two IPv6 addresses. In case a subnet is given, it checks if it contains the request IP.

Author
David Soria Parra <dsp at php dot net>
See also
https://github.com/dsp/v6tools
Parameters
string$requestIpIPv6 address to check
string$ipIPv6 address or subnet in CIDR notation
Returns
bool Whether the IP is valid
Exceptions

Definition at line 112 of file vendor/symfony/http-foundation/IpUtils.php.


The documentation for this class was generated from the following file: