Index: trunk/phase3/includes/ProxyTools.php |
— | — | @@ -53,11 +53,20 @@ |
54 | 54 | * @return bool |
55 | 55 | */ |
56 | 56 | function wfIsTrustedProxy( $ip ) { |
| 57 | + $trusted = wfIsConfiguredProxy( $ip ); |
| 58 | + wfRunHooks( 'IsTrustedProxy', array( &$ip, &$trusted ) ); |
| 59 | + return $trusted; |
| 60 | +} |
| 61 | + |
| 62 | +/** |
| 63 | + * Checks if an IP matches a proxy we've configured. |
| 64 | + * @param $ip String |
| 65 | + * @return bool |
| 66 | + */ |
| 67 | +function wfIsConfiguredProxy( $ip ) { |
57 | 68 | global $wgSquidServers, $wgSquidServersNoPurge; |
58 | | - |
59 | 69 | $trusted = in_array( $ip, $wgSquidServers ) || |
60 | 70 | in_array( $ip, $wgSquidServersNoPurge ); |
61 | | - wfRunHooks( 'IsTrustedProxy', array( &$ip, &$trusted ) ); |
62 | 71 | return $trusted; |
63 | 72 | } |
64 | 73 | |