Update BouncerService.php

pull/6417/head
Shlee 8 months ago committed by GitHub
parent ef6187b917
commit eac489e856
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -13,7 +13,17 @@ class BouncerService
$knownCloudCidrs = Cache::rememberForever('pf:bouncer-service:check-ip:known-cloud-cidrs', function () {
$file = Storage::get('bouncer/all.json');
return json_decode($file, true);
if ($file === null) {
return [];
}
$decoded = json_decode($file, true);
if ($decoded === null || !is_array($decoded)) {
return [];
}
return $decoded;
});
return IpUtils::checkIp($ip, $knownCloudCidrs);

Loading…
Cancel
Save