MediaWiki  REL1_19
ProxyTools.php File Reference

Functions for dealing with proxies. More...

Go to the source code of this file.

Functions

 wfGetAgent ()
 Returns the browser/OS data from the request header Note: headers are spoofable.
 wfGetForwardedFor ()
 Extracts the XFF string from the request header Note: headers are spoofable.
 wfGetIP ()
 Work out the IP address based on various globals For trusted proxies, use the XFF client IP (first of the chain)
 wfIsTrustedProxy ($ip)
 Checks if an IP is a trusted proxy providor.
 wfProxyCheck ()
 Forks processes to scan the originating IP for an open proxy server MemCached can be used to skip IPs that have already been scanned.

Detailed Description

Functions for dealing with proxies.

Definition in file ProxyTools.php.


Function Documentation

Returns the browser/OS data from the request header Note: headers are spoofable.

Deprecated:
in 1.18; use $wgRequest->getHeader( 'User-Agent' ) instead.
Returns:
string

Definition at line 28 of file ProxyTools.php.

References wfDeprecated().

Here is the call graph for this function:

Extracts the XFF string from the request header Note: headers are spoofable.

Deprecated:
in 1.19; use $wgRequest->getHeader( 'X-Forwarded-For' ) instead.
Returns:
string

Definition at line 15 of file ProxyTools.php.

References wfDeprecated().

Here is the call graph for this function:

wfGetIP ( )

Work out the IP address based on various globals For trusted proxies, use the XFF client IP (first of the chain)

Deprecated:
in 1.19; call $wgRequest->getIP() directly.
Returns:
string

Definition at line 41 of file ProxyTools.php.

References wfDeprecated().

Here is the call graph for this function:

wfIsTrustedProxy ( ip)

Checks if an IP is a trusted proxy providor.

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

Parameters:
$ipString
Returns:
bool

Definition at line 55 of file ProxyTools.php.

References $wgSquidServers, $wgSquidServersNoPurge, and wfRunHooks().

Here is the call graph for this function:

Forks processes to scan the originating IP for an open proxy server MemCached can be used to skip IPs that have already been scanned.

Definition at line 68 of file ProxyTools.php.

References $title, $url, $wgBlockOpenProxies, $wgMemc, $wgProxyKey, $wgProxyMemcExpiry, $wgProxyPorts, $wgProxyScriptPath, SpecialPage\getTitleFor(), wfExpandUrl(), wfGetNull(), and wfMemcKey().

Referenced by EditPage\initialiseForm().

Here is the call graph for this function:

Here is the caller graph for this function: