MediaWiki  1.34.0
ProxyLookup Class Reference
Collaboration diagram for ProxyLookup:

Public Member Functions

 __construct ( $proxyServers, $proxyServersComplex)
 
 isConfiguredProxy ( $ip)
 Checks if an IP matches a proxy we've configured. More...
 
 isTrustedProxy ( $ip)
 Checks if an IP is a trusted proxy provider. More...
 

Private Attributes

IPSet null $proxyIPSet
 
string[] $proxyServers
 
string[] $proxyServersComplex
 

Detailed Description

Since
1.28

Definition at line 27 of file ProxyLookup.php.

Constructor & Destructor Documentation

◆ __construct()

ProxyLookup::__construct (   $proxyServers,
  $proxyServersComplex 
)
Parameters
string[]$proxyServersSimple list of IPs
string[]$proxyServersComplexComplex list of IPs/ranges

Definition at line 48 of file ProxyLookup.php.

References $proxyServers, and $proxyServersComplex.

Member Function Documentation

◆ isConfiguredProxy()

ProxyLookup::isConfiguredProxy (   $ip)

Checks if an IP matches a proxy we've configured.

Parameters
string$ip
Returns
bool

Definition at line 59 of file ProxyLookup.php.

Referenced by isTrustedProxy().

◆ isTrustedProxy()

ProxyLookup::isTrustedProxy (   $ip)

Checks if an IP is a trusted proxy provider.

Useful to tell if X-Forwarded-For data is possibly bogus. CDN cache servers for the site are whitelisted.

Parameters
string$ip
Returns
bool

Definition at line 80 of file ProxyLookup.php.

References isConfiguredProxy(), and Hooks\run().

Member Data Documentation

◆ $proxyIPSet

IPSet null ProxyLookup::$proxyIPSet
private

Definition at line 42 of file ProxyLookup.php.

◆ $proxyServers

string [] ProxyLookup::$proxyServers
private

Definition at line 32 of file ProxyLookup.php.

Referenced by __construct().

◆ $proxyServersComplex

string [] ProxyLookup::$proxyServersComplex
private

Definition at line 37 of file ProxyLookup.php.

Referenced by __construct().


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