From 4f7dc7b5ee593a5fec3196f98505b6c62c0b45f6 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 23 Jul 2024 11:45:07 +0200 Subject: [statistics_reporting] Fix undefined variable access This had no consequence as $start could only be undefined if $bounds is false, in which case the variable $sh was never read, but still, avoid the warning. --- modules-available/statistics_reporting/inc/queries.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules-available') diff --git a/modules-available/statistics_reporting/inc/queries.inc.php b/modules-available/statistics_reporting/inc/queries.inc.php index 410f9517..14849a19 100644 --- a/modules-available/statistics_reporting/inc/queries.inc.php +++ b/modules-available/statistics_reporting/inc/queries.inc.php @@ -229,7 +229,7 @@ class Queries */ $machine[$row['typeid']] += self::timeDiff($start, $end, $bounds); } - $sh = date('G', $start); + $sh = date('G', $start ?? 0); if ($row['typeid'] === 'totalSessionTime' && ($bounds === false || ($sh >= $bounds[0] && $sh < $bounds[1]))) { if ($row['data'] >= 60) { $machine['longSessions'] += 1; -- cgit v1.2.3-55-g7522