Skip to content

Commit 10b1c66

Browse files
committed
Fix multiplication of modifier in relTimeToSeconds
1 parent 7903400 commit 10b1c66

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

webapp/src/Utils/Utils.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,10 @@ public static function relTimeToSeconds(string $reltime): float
213213
preg_match(self::RELTIME_REGEX, $reltime, $data);
214214
$negative = ($data[1] === '-');
215215
$modifier = $negative ? -1 : 1;
216-
$seconds = $modifier * (int)$data[2] * 3600
216+
$seconds = $modifier * (
217+
(int)$data[2] * 3600
217218
+ (int)$data[3] * 60
218-
+ (float)sprintf('%d.%03d', $data[4], $data[5] ?? 0);
219+
+ (float)sprintf('%d.%03d', $data[4], $data[5] ?? 0));
219220
return $seconds;
220221
}
221222

0 commit comments

Comments
 (0)