Parcourir la source

Fixed a flaw (if the passed amount of seconds was 0 it could return nothing)

pezcurrel il y a 2 mois
Parent
commit
77d8ab3063
1 fichiers modifiés avec 1 ajouts et 6 suppressions
  1. 1 6
      web/lib/ght.php

+ 1 - 6
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;
 }