You've already forked Epicnabbo-Catalogus-Updated-Daily
🆙 More fixes 🆙
This commit is contained in:
@@ -40,7 +40,18 @@ class VPNCheckerMiddleware
|
||||
$userIp = $request->ip();
|
||||
$apiResponse = $ipService->ipLookup($userIp);
|
||||
|
||||
$asn = $apiResponse['asn']['asn'] ?? '';
|
||||
$asn = '';
|
||||
if (is_array($apiResponse)) {
|
||||
$asnSection = $apiResponse['asn'] ?? null;
|
||||
if (is_array($asnSection)) {
|
||||
$asnValue = $asnSection['asn'] ?? null;
|
||||
if (is_string($asnValue)) {
|
||||
$asn = $asnValue;
|
||||
} elseif (is_int($asnValue)) {
|
||||
$asn = (string) $asnValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
$asnWhitelisted = WebsiteIpWhitelist::where('asn', $asn)
|
||||
->where('whitelist_asn', '=', '1')
|
||||
->exists();
|
||||
@@ -61,8 +72,11 @@ class VPNCheckerMiddleware
|
||||
]);
|
||||
}
|
||||
|
||||
if (isset($apiResponse['threat']) && is_array($apiResponse['threat'])) {
|
||||
$filteredThreats = array_diff_key($apiResponse['threat'], array_flip(['blocklists', 'is_icloud_relay', 'is_datacenter', 'is_tor', 'is_proxy']));
|
||||
if (is_array($apiResponse) && isset($apiResponse['threat']) && is_array($apiResponse['threat'])) {
|
||||
$filteredThreats = array_diff_key(
|
||||
$apiResponse['threat'],
|
||||
array_flip(['blocklists', 'is_icloud_relay', 'is_datacenter', 'is_tor', 'is_proxy'])
|
||||
);
|
||||
|
||||
if (in_array(true, $filteredThreats, true)) {
|
||||
WebsiteIpBlacklist::create([
|
||||
|
||||
Reference in New Issue
Block a user