From 7d4992480b05c5095a9e2fd247280c49c7ae40e7 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Fri, 3 Sep 2021 03:42:00 +0200 Subject: [PATCH] Fix PHP warning --- src/hostname.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hostname.php b/src/hostname.php index 30f4a21..842a416 100644 --- a/src/hostname.php +++ b/src/hostname.php @@ -15,7 +15,8 @@ function gethost($ip) $ires = array(); $host = `host -s -W 5 $ip`; - $host = ($host ? end( explode(' ', trim(trim($host), '.'))) : $ip); + $host = explode(' ', trim(trim($host), '.')); + $host = ($host ? end($host) : $ip); $ires = array(); if(in_array($host, Array('reached', 'record', '3(NXDOMAIN)'))) {