- system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Tools.php file in order to filter the IP address . The most relevant location to where these types of verifications should be made would be on the:
- catalog/controller/api/login.php file.
Find:
Code: Select all
if (!in_array($this->request->server['REMOTE_ADDR'], $ip_data)) {
Code: Select all
if (!in_array($this->getIpAddress(), $ip_data)) {
Code: Select all
}
Code: Select all
protected function getIpAddress() {
foreach (array('HTTP_X_FORWARDED_FOR', 'HTTP_CLIENT_IP', 'HTTP_X_CLIENT_IP', 'HTTP_X_CLUSTER_CLIENT_IP', 'REMOTE_ADDR') as $header) {
if (!isset($this->request->server[$header]) || ($spoof = $this->request->server[$header]) === NULL) {
continue;
}
sscanf($spoof, '%[^,]', $spoof);
if (!filter_var($spoof, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
$spoof = NULL;
} else {
return $spoof;
}
}
return '0.0.0.0';
}