Optimise code.

This commit is contained in:
James Cole
2020-10-24 17:27:36 +02:00
parent b3f1737495
commit 3979e12043
21 changed files with 199 additions and 187 deletions

View File

@@ -57,9 +57,9 @@ class NewIPAddressWarningMail extends Mailable
// time
$this->time = now()->formatLocalized((string)trans('config.date_time'));
$this->host = '';
$host = gethostbyaddr($this->ipAddress);
if($host !== $this->ipAddress) {
$this->host = $host;
$hostName = gethostbyaddr($this->ipAddress);
if($hostName !== $this->ipAddress) {
$this->host = $hostName;
}
return $this->view('emails.new-ip-html')->text('emails.new-ip-text')