From 4073984fd7391386ab8bbccc913755c646049d86 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sun, 31 Dec 2023 16:16:01 +0100 Subject: [PATCH] traffic-cron: check for standardsubdomain to be in the domainlist array to avoid undefined index if e.g. an alias was set to the standardsubdomain Signed-off-by: Michael Kaufmann --- lib/Froxlor/Cron/Traffic/TrafficCron.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Froxlor/Cron/Traffic/TrafficCron.php b/lib/Froxlor/Cron/Traffic/TrafficCron.php index 4c11dcdf..3d974c9d 100644 --- a/lib/Froxlor/Cron/Traffic/TrafficCron.php +++ b/lib/Froxlor/Cron/Traffic/TrafficCron.php @@ -163,14 +163,14 @@ class TrafficCron extends FroxlorCron if (isset($domainlist[$row['customerid']]) && is_array($domainlist[$row['customerid']]) && count($domainlist[$row['customerid']]) != 0) { // Examining which caption to use for default webalizer stats... - if ($row['standardsubdomain'] != '0') { + if ($row['standardsubdomain'] != '0' && isset($domainlist[$row['customerid']][$row['standardsubdomain']])) { // ... of course we'd prefer to use the standardsubdomain ... $caption = $domainlist[$row['customerid']][$row['standardsubdomain']]; } else { // ... but if there is no standardsubdomain, we have to use the loginname ... $caption = $row['loginname']; - // ... which results in non-usable links to files in the stats, so lets have a look if we find a domain which is not speciallogfiledomain + // ... which results in non-usable links to files in the stats, so let's have a look if we find a domain which is not speciallogfiledomain foreach ($domainlist[$row['customerid']] as $domainid => $domain) { if (!isset($speciallogfile_domainlist[$row['customerid']]) || !isset($speciallogfile_domainlist[$row['customerid']][$domainid])) { $caption = $domain;