From 77d8ab306377b8093b0ab556539a0dd07ae5314b Mon Sep 17 00:00:00 2001 From: pezcurrel Date: Sun, 25 Feb 2024 08:57:34 +0100 Subject: [PATCH] Fixed a flaw (if the passed amount of seconds was 0 it could return nothing) --- web/lib/ght.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/web/lib/ght.php b/web/lib/ght.php index 2e6512b..0d7a5f7 100644 --- a/web/lib/ght.php +++ b/web/lib/ght.php @@ -70,12 +70,7 @@ $ozero is whether to include a zero value for a unit if ($buniti>=1) { if ($out!='') $osep=$sep; $x=round($ts,$sd); - if ($x>0 || $ozero) { - if ($sd>0 || $x!=1) - $out.=$osep.$x.' '.$fa[$i+1]; - elseif ($x==1) - $out.=$osep.$x.' '.$fa[$i]; - } + ($x==1) ? $out.=$osep.$x.' '.$fa[$i] : $out.=$osep.$x.' '.$fa[$i+1]; } return $out; }