From f23caceceeb36aae6ec9b88ea29350992f458c2e Mon Sep 17 00:00:00 2001 From: Squidly271 Date: Sun, 15 Dec 2024 19:50:01 -0500 Subject: [PATCH] Fix PHP8 warning --- emhttp/plugins/dynamix.apcupsd/include/UPSstatus.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/emhttp/plugins/dynamix.apcupsd/include/UPSstatus.php b/emhttp/plugins/dynamix.apcupsd/include/UPSstatus.php index a4a479922..18eb58313 100644 --- a/emhttp/plugins/dynamix.apcupsd/include/UPSstatus.php +++ b/emhttp/plugins/dynamix.apcupsd/include/UPSstatus.php @@ -1,6 +1,6 @@ 0 ? "$power W" : "$power W"; } - if ($power && isset($load)) $status[5] = ($load<90 ? "" : "").round($power*$load/100)." W (".$status[5].")"; + if ( ($power??false) && isset($load)) $status[5] = ($load<90 ? "" : "").round($power*$load/100)." W (".$status[5].")"; elseif (isset($load)) $status[5] = ($load<90 ? "" : "").$status[5].""; $status[6] = isset($output) ? ((!$volt || ($minv<$output && $output<$maxv) ? "" : "").$status[6].(isset($freq) ? " ~ $freq Hz" : "")."") : $status[6]; }