From 85314b3a235e6d09a8da390cdcc4a70f439ca9db Mon Sep 17 00:00:00 2001 From: fusionate Date: Wed, 24 May 2023 00:28:10 +0000 Subject: [PATCH] Time Conditions [Class]: Updates for PHP 8.1 --- app/time_conditions/resources/classes/time_conditions.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/time_conditions/resources/classes/time_conditions.php b/app/time_conditions/resources/classes/time_conditions.php index 738ba33c7d..ef82061a9b 100644 --- a/app/time_conditions/resources/classes/time_conditions.php +++ b/app/time_conditions/resources/classes/time_conditions.php @@ -79,7 +79,7 @@ //build the delete array foreach ($records as $x => $record) { - if ($record['checked'] == 'true' && is_uuid($record['uuid'])) { + if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) { //build delete array $array[$this->table][$x][$this->uuid_prefix.'uuid'] = $record['uuid']; @@ -161,7 +161,7 @@ //get current toggle state foreach($records as $x => $record) { - if ($record['checked'] == 'true' && is_uuid($record['uuid'])) { + if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) { $uuids[] = "'".$record['uuid']."'"; } } @@ -252,7 +252,7 @@ //get checked records foreach($records as $x => $record) { - if ($record['checked'] == 'true' && is_uuid($record['uuid'])) { + if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) { $uuids[] = "'".$record['uuid']."'"; } } @@ -264,7 +264,7 @@ $sql = "select * from v_".$this->table." "; $sql .= "where ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") "; $database = new database; - $rows = $database->select($sql, $parameters, 'all'); + $rows = $database->select($sql, $parameters ?? null, 'all'); if (is_array($rows) && @sizeof($rows) != 0) { $y = 0; foreach ($rows as $x => $row) {