MediaWiki
REL1_22
|
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) | |
wfIsConfiguredProxy ($ip) | |
Checks if an IP matches a proxy we've configured. | |
wfIsTrustedProxy ($ip) | |
Checks if an IP is a trusted proxy provider. |
Functions for dealing with proxies.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html
Definition in file ProxyTools.php.
wfGetAgent | ( | ) |
Returns the browser/OS data from the request header Note: headers are spoofable.
Definition at line 43 of file ProxyTools.php.
References global, and wfDeprecated().
Extracts the XFF string from the request header Note: headers are spoofable.
Definition at line 30 of file ProxyTools.php.
References global, and wfDeprecated().
wfGetIP | ( | ) |
Work out the IP address based on various globals For trusted proxies, use the XFF client IP (first of the chain)
Definition at line 56 of file ProxyTools.php.
References global, and wfDeprecated().
wfIsConfiguredProxy | ( | $ | ip | ) |
Checks if an IP matches a proxy we've configured.
$ip | String |
Definition at line 81 of file ProxyTools.php.
References global.
Referenced by wfIsTrustedProxy().
wfIsTrustedProxy | ( | $ | ip | ) |
Checks if an IP is a trusted proxy provider.
Useful to tell if X-Forwarded-For data is possibly bogus. Squid cache servers for the site are whitelisted.
$ip | String |
Definition at line 70 of file ProxyTools.php.
References array(), wfIsConfiguredProxy(), and wfRunHooks().
Referenced by Block\getBlocksForIPList().