Merged in release/release-1.09 (pull request #10)
Release/release 1.09 * Install missing plugins * rs set to 1 * rebase pantheon for aws * rebase pantheon for aws * prod config change * prod config change * fix campaing issue * revert Approved-by: Jay Sharma
This commit is contained in:
committed by
Jay Sharma
parent
779393381f
commit
22f10a9edd
@@ -886,7 +886,7 @@ class wfUtils {
|
||||
}
|
||||
$skipToNext = false;
|
||||
if ($trustedProxies === null) {
|
||||
$trustedProxies = self::unifiedTrustedProxies();
|
||||
$trustedProxies = explode("\n", wfConfig::get('howGetIPs_trusted_proxies', ''));
|
||||
}
|
||||
foreach(array(',', ' ', "\t") as $char){
|
||||
if(strpos($item, $char) !== false){
|
||||
@@ -944,29 +944,6 @@ class wfUtils {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of all trusted proxies, combining both the user-entered ones and those from the selected preset.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public static function unifiedTrustedProxies() {
|
||||
$trustedProxies = explode("\n", wfConfig::get('howGetIPs_trusted_proxies', ''));
|
||||
|
||||
$preset = wfConfig::get('howGetIPs_trusted_proxy_preset');
|
||||
$presets = wfConfig::getJSON('ipResolutionList', array());
|
||||
if (is_array($presets) && isset($presets[$preset])) {
|
||||
$testIPs = array_merge($presets[$preset]['ipv4'], $presets[$preset]['ipv6']);
|
||||
foreach ($testIPs as $val) {
|
||||
if (strlen($val) > 0) {
|
||||
if (wfUtils::isValidIP($val) || wfUtils::isValidCIDRRange($val)) {
|
||||
$trustedProxies[] = $val;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $trustedProxies;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $ip
|
||||
|
||||
Reference in New Issue
Block a user