Skip to content

Commit 66104b4

Browse files
author
bohwaz
committed
Fix duration handling
FossilOrigin-Name: 535bea69dc4934d38a5d7589158cd7db63db0df3b624551e34ba7f11c78ff4cb
1 parent f96af7e commit 66104b4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/inc/Feed.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,9 @@ protected function getDuration(?string $str): ?int
142142
return null;
143143
}
144144

145-
if (false !== strpos($str, ':')) {
145+
if (false !== strpos($str, ':') && ctype_digit(str_replace(':', '', trim($str)))) {
146146
$parts = explode(':', $str);
147+
$parts = array_map('intval', $parts);
147148
$duration = ($parts[2] ?? 0) * 3600 + ($parts[1] ?? 0) * 60 + $parts[0] ?? 0;
148149
}
149150
else {

0 commit comments

Comments
 (0)