Extend warning with IP + host etc.

This commit is contained in:
James Cole
2024-12-22 06:33:37 +01:00
parent 2e993857e8
commit bffa0088b4
5 changed files with 33 additions and 28 deletions

View File

@@ -770,13 +770,20 @@ class Steam
*/
public function getHostName(string $ipAddress): string
{
$host = '';
try {
$hostName = gethostbyaddr($ipAddress);
} catch (\Exception $e) { // intentional generic exception
throw new FireflyException($e->getMessage(), 0, $e);
} catch (\Exception $e) {
app('log')->error($e->getMessage());
$hostName = $ipAddress;
}
return (string) $hostName;
if ('' !== (string) $hostName && $hostName !== $ipAddress) {
$host = $hostName;
}
return (string) $host;
}
public function getLastActivities(array $accounts): array