From 1333697143cab7dabd944a2f6c6742222d6c35de Mon Sep 17 00:00:00 2001 From: Lukas Scharmer Date: Tue, 17 Dec 2024 16:35:02 +0100 Subject: [PATCH] Chatroom: Add missing typecast for JS timestamps (ms) --- Modules/Chatroom/classes/class.ilChatroom.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/Chatroom/classes/class.ilChatroom.php b/Modules/Chatroom/classes/class.ilChatroom.php index 35948fcf32f7..b1d58cf5a582 100644 --- a/Modules/Chatroom/classes/class.ilChatroom.php +++ b/Modules/Chatroom/classes/class.ilChatroom.php @@ -823,8 +823,8 @@ public function getLastMessages(int $number, ilChatroomUser $chatuser): array } usort($results, static function (stdClass $a, stdClass $b): int { - $a_timestamp = strlen((string) $a->timestamp) === 13 ? ((int) substr($a->timestamp, 0, -3)) : $a->timestamp; - $b_timestamp = strlen((string) $b->timestamp) === 13 ? ((int) substr($b->timestamp, 0, -3)) : $b->timestamp; + $a_timestamp = strlen((string) $a->timestamp) === 13 ? ((int) substr((string) $a->timestamp, 0, -3)) : $a->timestamp; + $b_timestamp = strlen((string) $b->timestamp) === 13 ? ((int) substr((string) $b->timestamp, 0, -3)) : $b->timestamp; return $b_timestamp - $a_timestamp; });