MediaWiki REL1_37
ProxyLookup Class Reference
Collaboration diagram for ProxyLookup:

Public Member Functions

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

Private Attributes

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

Detailed Description

Since
1.28

Definition at line 29 of file ProxyLookup.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 48 of file ProxyLookup.php.

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 64 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 allowed.

Parameters
string$ip
Returns
bool

Definition at line 85 of file ProxyLookup.php.

References isConfiguredProxy().

Member Data Documentation

◆ $hookRunner

HookRunner ProxyLookup::$hookRunner
private

Definition at line 41 of file ProxyLookup.php.

◆ $proxyIPSet

IPSet null ProxyLookup::$proxyIPSet
private

Definition at line 38 of file ProxyLookup.php.

◆ $proxyServers

string [] ProxyLookup::$proxyServers
private

Definition at line 32 of file ProxyLookup.php.

◆ $proxyServersComplex

string [] ProxyLookup::$proxyServersComplex
private

Definition at line 35 of file ProxyLookup.php.


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