You've already forked Epicnabbo-Catalogus-Updated-Daily
🆙 More fixes 🆙
This commit is contained in:
@@ -29,7 +29,7 @@ class FindRetrosService
|
||||
/**
|
||||
* Initialise Find Retros Service
|
||||
*/
|
||||
public function __construct(): void
|
||||
public function __construct()
|
||||
{
|
||||
$this->client = new Client(['verify' => false]);
|
||||
}
|
||||
@@ -43,8 +43,9 @@ class FindRetrosService
|
||||
return true;
|
||||
}
|
||||
|
||||
$cacheKey = sprintf(self::FIND_RETROS_CACHE_KEY, request()->ip());
|
||||
if (request()->ip() === '127.0.0.1') {
|
||||
$ip = request()->ip();
|
||||
$cacheKey = sprintf(self::FIND_RETROS_CACHE_KEY, is_scalar($ip) ? (string) $ip : '');
|
||||
if ($ip === '127.0.0.1') {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,7 +57,14 @@ class FindRetrosService
|
||||
return true;
|
||||
}
|
||||
|
||||
$uri = sprintf(self::FIND_RETROS_VERIFY_URI, config('habbo.findretros.api'), config('habbo.findretros.name'), request()->ip());
|
||||
$api = config('habbo.findretros.api');
|
||||
$name = config('habbo.findretros.name');
|
||||
|
||||
$uri = sprintf(self::FIND_RETROS_VERIFY_URI,
|
||||
is_scalar($api) ? (string) $api : '',
|
||||
is_scalar($name) ? (string) $name : '',
|
||||
is_scalar($ip) ? (string) $ip : ''
|
||||
);
|
||||
$request = $this->client->get($uri);
|
||||
$response = $request->getBody()->getContents();
|
||||
|
||||
@@ -74,6 +82,12 @@ class FindRetrosService
|
||||
*/
|
||||
public function getRedirectUri(): string
|
||||
{
|
||||
return sprintf(self::FIND_RETROS_REDIRECT_URI, config('habbo.findretros.api'), config('habbo.findretros.name'));
|
||||
$api = config('habbo.findretros.api');
|
||||
$name = config('habbo.findretros.name');
|
||||
|
||||
return sprintf(self::FIND_RETROS_REDIRECT_URI,
|
||||
is_scalar($api) ? (string) $api : '',
|
||||
is_scalar($name) ? (string) $name : ''
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user