MediaWiki  1.28.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

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

Definition at line 48 of file ProxyLookup.php.

References $proxyServers, and $proxyServersComplex.

Member Function Documentation

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().

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

IPSet null ProxyLookup::$proxyIPSet
private

Definition at line 42 of file ProxyLookup.php.

string [] ProxyLookup::$proxyServers
private

Definition at line 32 of file ProxyLookup.php.

Referenced by __construct().

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: